{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 小红书服饰行业可视化数据分析文档"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "# 导入相关包\n",
    "import pandas as pd\n",
    "import datetime\n",
    "import matplotlib.pyplot as plt\n",
    "import seaborn as sns\n",
    "from pyecharts.charts import Line,Map,Bar\n",
    "from pyecharts import options as opts"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "#解决图表在notebook上显示不了的问题：https://blog.csdn.net/weixin_39198406/article/details/106229653\n",
    "# 只需要在顶部声明 CurrentConfig.ONLINE_HOST 即可\n",
    "from pyecharts.globals import CurrentConfig, OnlineHostType\n",
    "# OnlineHostType.NOTEBOOK_HOST 默认值为 http://localhost:8888/nbextensions/assets/\n",
    "CurrentConfig.ONLINE_HOST = OnlineHostType.NOTEBOOK_HOST"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 小红书粉丝用户画像"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 1.粉丝地域分布"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>行业id</th>\n",
       "      <th>行业名称</th>\n",
       "      <th>省份</th>\n",
       "      <th>占比</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1698</td>\n",
       "      <td>连衣裙</td>\n",
       "      <td>广东</td>\n",
       "      <td>18.92</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1698</td>\n",
       "      <td>连衣裙</td>\n",
       "      <td>北京</td>\n",
       "      <td>8.18</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>1698</td>\n",
       "      <td>连衣裙</td>\n",
       "      <td>上海</td>\n",
       "      <td>8.10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>1698</td>\n",
       "      <td>连衣裙</td>\n",
       "      <td>浙江</td>\n",
       "      <td>7.84</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>1698</td>\n",
       "      <td>连衣裙</td>\n",
       "      <td>江苏</td>\n",
       "      <td>6.33</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>694</th>\n",
       "      <td>3205</td>\n",
       "      <td>皮衣</td>\n",
       "      <td>澳门</td>\n",
       "      <td>0.59</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>695</th>\n",
       "      <td>3205</td>\n",
       "      <td>皮衣</td>\n",
       "      <td>香港</td>\n",
       "      <td>0.59</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>696</th>\n",
       "      <td>3205</td>\n",
       "      <td>皮衣</td>\n",
       "      <td>云南</td>\n",
       "      <td>0.59</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>697</th>\n",
       "      <td>3205</td>\n",
       "      <td>皮衣</td>\n",
       "      <td>吉林</td>\n",
       "      <td>0.59</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>698</th>\n",
       "      <td>3205</td>\n",
       "      <td>皮衣</td>\n",
       "      <td>西藏</td>\n",
       "      <td>0.59</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>699 rows × 4 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "     行业id 行业名称  省份     占比\n",
       "0    1698  连衣裙  广东  18.92\n",
       "1    1698  连衣裙  北京   8.18\n",
       "2    1698  连衣裙  上海   8.10\n",
       "3    1698  连衣裙  浙江   7.84\n",
       "4    1698  连衣裙  江苏   6.33\n",
       "..    ...  ...  ..    ...\n",
       "694  3205   皮衣  澳门   0.59\n",
       "695  3205   皮衣  香港   0.59\n",
       "696  3205   皮衣  云南   0.59\n",
       "697  3205   皮衣  吉林   0.59\n",
       "698  3205   皮衣  西藏   0.59\n",
       "\n",
       "[699 rows x 4 columns]"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 导入数据文件\n",
    "df1=pd.read_excel('服饰行业粉丝地域分布.xlsx')\n",
    "df1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>省份</th>\n",
       "      <th>占比</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>上海</td>\n",
       "      <td>9.495455</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>云南</td>\n",
       "      <td>1.968182</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>内蒙古</td>\n",
       "      <td>0.357500</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>北京</td>\n",
       "      <td>10.532727</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>台湾</td>\n",
       "      <td>0.256471</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>吉林</td>\n",
       "      <td>1.056500</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>四川</td>\n",
       "      <td>6.239091</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>天津</td>\n",
       "      <td>1.755455</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>宁夏</td>\n",
       "      <td>0.258750</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>安徽</td>\n",
       "      <td>2.368636</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>山东</td>\n",
       "      <td>4.550000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>山西</td>\n",
       "      <td>0.834286</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>广东</td>\n",
       "      <td>16.327727</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>广西</td>\n",
       "      <td>1.478095</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>新疆</td>\n",
       "      <td>0.384444</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>江苏</td>\n",
       "      <td>6.367727</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>江西</td>\n",
       "      <td>1.570909</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>河北</td>\n",
       "      <td>2.132273</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>河南</td>\n",
       "      <td>2.898182</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19</th>\n",
       "      <td>浙江</td>\n",
       "      <td>7.887273</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20</th>\n",
       "      <td>海南</td>\n",
       "      <td>0.466500</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>21</th>\n",
       "      <td>湖北</td>\n",
       "      <td>3.155455</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>22</th>\n",
       "      <td>湖南</td>\n",
       "      <td>3.117273</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>23</th>\n",
       "      <td>澳门</td>\n",
       "      <td>0.206250</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24</th>\n",
       "      <td>甘肃</td>\n",
       "      <td>0.422857</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25</th>\n",
       "      <td>福建</td>\n",
       "      <td>4.225455</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>26</th>\n",
       "      <td>蒙古</td>\n",
       "      <td>0.085000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>27</th>\n",
       "      <td>西藏</td>\n",
       "      <td>0.157857</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>28</th>\n",
       "      <td>贵州</td>\n",
       "      <td>0.606000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>29</th>\n",
       "      <td>辽宁</td>\n",
       "      <td>2.667273</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>30</th>\n",
       "      <td>重庆</td>\n",
       "      <td>2.650455</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>31</th>\n",
       "      <td>陕西</td>\n",
       "      <td>2.256818</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32</th>\n",
       "      <td>青海</td>\n",
       "      <td>0.107778</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>33</th>\n",
       "      <td>香港</td>\n",
       "      <td>0.635000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>34</th>\n",
       "      <td>黑龙江</td>\n",
       "      <td>1.415000</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "     省份         占比\n",
       "0    上海   9.495455\n",
       "1    云南   1.968182\n",
       "2   内蒙古   0.357500\n",
       "3    北京  10.532727\n",
       "4    台湾   0.256471\n",
       "5    吉林   1.056500\n",
       "6    四川   6.239091\n",
       "7    天津   1.755455\n",
       "8    宁夏   0.258750\n",
       "9    安徽   2.368636\n",
       "10   山东   4.550000\n",
       "11   山西   0.834286\n",
       "12   广东  16.327727\n",
       "13   广西   1.478095\n",
       "14   新疆   0.384444\n",
       "15   江苏   6.367727\n",
       "16   江西   1.570909\n",
       "17   河北   2.132273\n",
       "18   河南   2.898182\n",
       "19   浙江   7.887273\n",
       "20   海南   0.466500\n",
       "21   湖北   3.155455\n",
       "22   湖南   3.117273\n",
       "23   澳门   0.206250\n",
       "24   甘肃   0.422857\n",
       "25   福建   4.225455\n",
       "26   蒙古   0.085000\n",
       "27   西藏   0.157857\n",
       "28   贵州   0.606000\n",
       "29   辽宁   2.667273\n",
       "30   重庆   2.650455\n",
       "31   陕西   2.256818\n",
       "32   青海   0.107778\n",
       "33   香港   0.635000\n",
       "34  黑龙江   1.415000"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "fs_dy=df1.groupby('省份')['占比'].mean().reset_index()\n",
    "fs_dy"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[['上海', 9.495454545454544],\n",
       " ['云南', 1.9681818181818185],\n",
       " ['内蒙古', 0.35750000000000004],\n",
       " ['北京', 10.532727272727273],\n",
       " ['台湾', 0.2564705882352941],\n",
       " ['吉林', 1.0565],\n",
       " ['四川', 6.239090909090908],\n",
       " ['天津', 1.7554545454545454],\n",
       " ['宁夏', 0.25875],\n",
       " ['安徽', 2.368636363636363],\n",
       " ['山东', 4.549999999999999],\n",
       " ['山西', 0.8342857142857143],\n",
       " ['广东', 16.327727272727273],\n",
       " ['广西', 1.4780952380952384],\n",
       " ['新疆', 0.38444444444444437],\n",
       " ['江苏', 6.367727272727273],\n",
       " ['江西', 1.5709090909090906],\n",
       " ['河北', 2.132272727272727],\n",
       " ['河南', 2.898181818181818],\n",
       " ['浙江', 7.887272727272728],\n",
       " ['海南', 0.4664999999999999],\n",
       " ['湖北', 3.155454545454545],\n",
       " ['湖南', 3.1172727272727268],\n",
       " ['澳门', 0.20625],\n",
       " ['甘肃', 0.4228571428571428],\n",
       " ['福建', 4.225454545454545],\n",
       " ['蒙古', 0.085],\n",
       " ['西藏', 0.15785714285714286],\n",
       " ['贵州', 0.6060000000000001],\n",
       " ['辽宁', 2.6672727272727275],\n",
       " ['重庆', 2.6504545454545454],\n",
       " ['陕西', 2.2568181818181814],\n",
       " ['青海', 0.10777777777777778],\n",
       " ['香港', 0.635],\n",
       " ['黑龙江', 1.4149999999999998]]"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "[list(i) for i in zip(fs_dy['省份'].tolist(),fs_dy['占比'].tolist())]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### 数据可视化"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts':'http://localhost:8888/nbextensions/assets/echarts.min', 'china':'http://localhost:8888/nbextensions/assets/maps/china'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "\n",
       "        <div id=\"406863fc1c044d5686ade3c982cce504\" style=\"width:900px; height:500px;\"></div>\n",
       "\n",
       "<script>\n",
       "        require(['echarts', 'china'], function(echarts) {\n",
       "                var chart_406863fc1c044d5686ade3c982cce504 = echarts.init(\n",
       "                    document.getElementById('406863fc1c044d5686ade3c982cce504'), 'white', {renderer: 'canvas'});\n",
       "                var option_406863fc1c044d5686ade3c982cce504 = {\n",
       "    \"animation\": true,\n",
       "    \"animationThreshold\": 2000,\n",
       "    \"animationDuration\": 1000,\n",
       "    \"animationEasing\": \"cubicOut\",\n",
       "    \"animationDelay\": 0,\n",
       "    \"animationDurationUpdate\": 300,\n",
       "    \"animationEasingUpdate\": \"cubicOut\",\n",
       "    \"animationDelayUpdate\": 0,\n",
       "    \"color\": [\n",
       "        \"#c23531\",\n",
       "        \"#2f4554\",\n",
       "        \"#61a0a8\",\n",
       "        \"#d48265\",\n",
       "        \"#749f83\",\n",
       "        \"#ca8622\",\n",
       "        \"#bda29a\",\n",
       "        \"#6e7074\",\n",
       "        \"#546570\",\n",
       "        \"#c4ccd3\",\n",
       "        \"#f05b72\",\n",
       "        \"#ef5b9c\",\n",
       "        \"#f47920\",\n",
       "        \"#905a3d\",\n",
       "        \"#fab27b\",\n",
       "        \"#2a5caa\",\n",
       "        \"#444693\",\n",
       "        \"#726930\",\n",
       "        \"#b2d235\",\n",
       "        \"#6d8346\",\n",
       "        \"#ac6767\",\n",
       "        \"#1d953f\",\n",
       "        \"#6950a1\",\n",
       "        \"#918597\"\n",
       "    ],\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"map\",\n",
       "            \"name\": \"\\u7701\\u4efd/\\u5360\\u6bd4\",\n",
       "            \"label\": {\n",
       "                \"show\": true,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8\n",
       "            },\n",
       "            \"mapType\": \"china\",\n",
       "            \"data\": [\n",
       "                {\n",
       "                    \"name\": \"\\u4e0a\\u6d77\",\n",
       "                    \"value\": 9.495454545454544\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u4e91\\u5357\",\n",
       "                    \"value\": 1.9681818181818185\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5185\\u8499\\u53e4\",\n",
       "                    \"value\": 0.35750000000000004\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5317\\u4eac\",\n",
       "                    \"value\": 10.532727272727273\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u53f0\\u6e7e\",\n",
       "                    \"value\": 0.2564705882352941\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5409\\u6797\",\n",
       "                    \"value\": 1.0565\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u56db\\u5ddd\",\n",
       "                    \"value\": 6.239090909090908\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5929\\u6d25\",\n",
       "                    \"value\": 1.7554545454545454\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5b81\\u590f\",\n",
       "                    \"value\": 0.25875\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5b89\\u5fbd\",\n",
       "                    \"value\": 2.368636363636363\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5c71\\u4e1c\",\n",
       "                    \"value\": 4.549999999999999\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5c71\\u897f\",\n",
       "                    \"value\": 0.8342857142857143\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5e7f\\u4e1c\",\n",
       "                    \"value\": 16.327727272727273\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5e7f\\u897f\",\n",
       "                    \"value\": 1.4780952380952384\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u65b0\\u7586\",\n",
       "                    \"value\": 0.38444444444444437\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u6c5f\\u82cf\",\n",
       "                    \"value\": 6.367727272727273\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u6c5f\\u897f\",\n",
       "                    \"value\": 1.5709090909090906\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u6cb3\\u5317\",\n",
       "                    \"value\": 2.132272727272727\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u6cb3\\u5357\",\n",
       "                    \"value\": 2.898181818181818\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u6d59\\u6c5f\",\n",
       "                    \"value\": 7.887272727272728\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u6d77\\u5357\",\n",
       "                    \"value\": 0.4664999999999999\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u6e56\\u5317\",\n",
       "                    \"value\": 3.155454545454545\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u6e56\\u5357\",\n",
       "                    \"value\": 3.1172727272727268\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u6fb3\\u95e8\",\n",
       "                    \"value\": 0.20625\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u7518\\u8083\",\n",
       "                    \"value\": 0.4228571428571428\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u798f\\u5efa\",\n",
       "                    \"value\": 4.225454545454545\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u8499\\u53e4\",\n",
       "                    \"value\": 0.085\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u897f\\u85cf\",\n",
       "                    \"value\": 0.15785714285714286\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u8d35\\u5dde\",\n",
       "                    \"value\": 0.6060000000000001\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u8fbd\\u5b81\",\n",
       "                    \"value\": 2.6672727272727275\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u91cd\\u5e86\",\n",
       "                    \"value\": 2.6504545454545454\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u9655\\u897f\",\n",
       "                    \"value\": 2.2568181818181814\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u9752\\u6d77\",\n",
       "                    \"value\": 0.10777777777777778\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u9999\\u6e2f\",\n",
       "                    \"value\": 0.635\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u9ed1\\u9f99\\u6c5f\",\n",
       "                    \"value\": 1.4149999999999998\n",
       "                }\n",
       "            ],\n",
       "            \"roam\": true,\n",
       "            \"aspectScale\": 0.75,\n",
       "            \"nameProperty\": \"name\",\n",
       "            \"selectedMode\": false,\n",
       "            \"zoom\": 1,\n",
       "            \"mapValueCalculation\": \"sum\",\n",
       "            \"showLegendSymbol\": true,\n",
       "            \"emphasis\": {}\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"\\u7701\\u4efd/\\u5360\\u6bd4\"\n",
       "            ],\n",
       "            \"selected\": {\n",
       "                \"\\u7701\\u4efd/\\u5360\\u6bd4\": true\n",
       "            },\n",
       "            \"show\": true,\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10,\n",
       "            \"itemWidth\": 25,\n",
       "            \"itemHeight\": 14\n",
       "        }\n",
       "    ],\n",
       "    \"tooltip\": {\n",
       "        \"show\": true,\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"showContent\": true,\n",
       "        \"alwaysShowContent\": false,\n",
       "        \"showDelay\": 0,\n",
       "        \"hideDelay\": 100,\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"borderWidth\": 0,\n",
       "        \"padding\": 5\n",
       "    },\n",
       "    \"title\": [\n",
       "        {\n",
       "            \"text\": \"\\u7c89\\u4e1d\\u5730\\u57df\\u5206\\u5e03\",\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10\n",
       "        }\n",
       "    ],\n",
       "    \"toolbox\": {\n",
       "        \"show\": true,\n",
       "        \"orient\": \"horizontal\",\n",
       "        \"itemSize\": 15,\n",
       "        \"itemGap\": 10,\n",
       "        \"left\": \"90%\",\n",
       "        \"feature\": {\n",
       "            \"saveAsImage\": {\n",
       "                \"type\": \"png\",\n",
       "                \"backgroundColor\": \"auto\",\n",
       "                \"connectedBackgroundColor\": \"#fff\",\n",
       "                \"show\": true,\n",
       "                \"title\": \"\\u4fdd\\u5b58\\u4e3a\\u56fe\\u7247\",\n",
       "                \"pixelRatio\": 1\n",
       "            },\n",
       "            \"restore\": {\n",
       "                \"show\": true,\n",
       "                \"title\": \"\\u8fd8\\u539f\"\n",
       "            },\n",
       "            \"dataView\": {\n",
       "                \"show\": true,\n",
       "                \"title\": \"\\u6570\\u636e\\u89c6\\u56fe\",\n",
       "                \"readOnly\": false,\n",
       "                \"lang\": [\n",
       "                    \"\\u6570\\u636e\\u89c6\\u56fe\",\n",
       "                    \"\\u5173\\u95ed\",\n",
       "                    \"\\u5237\\u65b0\"\n",
       "                ],\n",
       "                \"backgroundColor\": \"#fff\",\n",
       "                \"textareaColor\": \"#fff\",\n",
       "                \"textareaBorderColor\": \"#333\",\n",
       "                \"textColor\": \"#000\",\n",
       "                \"buttonColor\": \"#c23531\",\n",
       "                \"buttonTextColor\": \"#fff\"\n",
       "            },\n",
       "            \"dataZoom\": {\n",
       "                \"show\": true,\n",
       "                \"title\": {\n",
       "                    \"zoom\": \"\\u533a\\u57df\\u7f29\\u653e\",\n",
       "                    \"back\": \"\\u533a\\u57df\\u7f29\\u653e\\u8fd8\\u539f\"\n",
       "                },\n",
       "                \"icon\": {},\n",
       "                \"xAxisIndex\": false,\n",
       "                \"yAxisIndex\": false,\n",
       "                \"filterMode\": \"filter\"\n",
       "            },\n",
       "            \"magicType\": {\n",
       "                \"show\": true,\n",
       "                \"type\": [\n",
       "                    \"line\",\n",
       "                    \"bar\",\n",
       "                    \"stack\",\n",
       "                    \"tiled\"\n",
       "                ],\n",
       "                \"title\": {\n",
       "                    \"line\": \"\\u5207\\u6362\\u4e3a\\u6298\\u7ebf\\u56fe\",\n",
       "                    \"bar\": \"\\u5207\\u6362\\u4e3a\\u67f1\\u72b6\\u56fe\",\n",
       "                    \"stack\": \"\\u5207\\u6362\\u4e3a\\u5806\\u53e0\",\n",
       "                    \"tiled\": \"\\u5207\\u6362\\u4e3a\\u5e73\\u94fa\"\n",
       "                },\n",
       "                \"icon\": {}\n",
       "            },\n",
       "            \"brush\": {\n",
       "                \"icon\": {},\n",
       "                \"title\": {\n",
       "                    \"rect\": \"\\u77e9\\u5f62\\u9009\\u62e9\",\n",
       "                    \"polygon\": \"\\u5708\\u9009\",\n",
       "                    \"lineX\": \"\\u6a2a\\u5411\\u9009\\u62e9\",\n",
       "                    \"lineY\": \"\\u7eb5\\u5411\\u9009\\u62e9\",\n",
       "                    \"keep\": \"\\u4fdd\\u6301\\u9009\\u62e9\",\n",
       "                    \"clear\": \"\\u6e05\\u9664\\u9009\\u62e9\"\n",
       "                }\n",
       "            }\n",
       "        }\n",
       "    },\n",
       "    \"visualMap\": {\n",
       "        \"show\": true,\n",
       "        \"type\": \"continuous\",\n",
       "        \"min\": 0,\n",
       "        \"max\": 10,\n",
       "        \"inRange\": {\n",
       "            \"color\": [\n",
       "                \"#50a3ba\",\n",
       "                \"#eac763\",\n",
       "                \"#d94e5d\"\n",
       "            ]\n",
       "        },\n",
       "        \"calculable\": true,\n",
       "        \"inverse\": false,\n",
       "        \"splitNumber\": 5,\n",
       "        \"orient\": \"vertical\",\n",
       "        \"showLabel\": true,\n",
       "        \"itemWidth\": 20,\n",
       "        \"itemHeight\": 140,\n",
       "        \"borderWidth\": 0\n",
       "    }\n",
       "};\n",
       "                chart_406863fc1c044d5686ade3c982cce504.setOption(option_406863fc1c044d5686ade3c982cce504);\n",
       "        });\n",
       "    </script>\n"
      ],
      "text/plain": [
       "<pyecharts.render.display.HTML at 0x1e5d00f49a0>"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from pyecharts import options as opts\n",
    "from pyecharts.charts import Map\n",
    "\n",
    "c = (\n",
    "    Map()\n",
    "    .add(\"省份/占比\", [list(i) for i in zip(fs_dy['省份'].tolist(),fs_dy['占比'].tolist())], \"china\")\n",
    "    .set_global_opts(\n",
    "        title_opts=opts.TitleOpts(title=\"粉丝地域分布\"),\n",
    "        visualmap_opts = opts.VisualMapOpts(\n",
    "            max_ = 10),  #峰值10\n",
    "        # 工具栏\n",
    "        toolbox_opts = opts.ToolboxOpts(\n",
    "        pos_left = \"90%\")\n",
    "     )  \n",
    ")\n",
    "c.render_notebook()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 粉丝活跃时间"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### 1.数据处理"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>行业id</th>\n",
       "      <th>行业名称</th>\n",
       "      <th>name</th>\n",
       "      <th>占比</th>\n",
       "      <th>type</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1698</td>\n",
       "      <td>连衣裙</td>\n",
       "      <td>周日</td>\n",
       "      <td>0.099072</td>\n",
       "      <td>week</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1698</td>\n",
       "      <td>连衣裙</td>\n",
       "      <td>周一</td>\n",
       "      <td>0.180806</td>\n",
       "      <td>week</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>1698</td>\n",
       "      <td>连衣裙</td>\n",
       "      <td>周二</td>\n",
       "      <td>0.186982</td>\n",
       "      <td>week</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>1698</td>\n",
       "      <td>连衣裙</td>\n",
       "      <td>周三</td>\n",
       "      <td>0.196898</td>\n",
       "      <td>week</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>1698</td>\n",
       "      <td>连衣裙</td>\n",
       "      <td>周四</td>\n",
       "      <td>0.102349</td>\n",
       "      <td>week</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>677</th>\n",
       "      <td>3205</td>\n",
       "      <td>皮衣</td>\n",
       "      <td>19:00</td>\n",
       "      <td>0.046352</td>\n",
       "      <td>hour</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>678</th>\n",
       "      <td>3205</td>\n",
       "      <td>皮衣</td>\n",
       "      <td>20:00</td>\n",
       "      <td>0.056652</td>\n",
       "      <td>hour</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>679</th>\n",
       "      <td>3205</td>\n",
       "      <td>皮衣</td>\n",
       "      <td>21:00</td>\n",
       "      <td>0.033476</td>\n",
       "      <td>hour</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>680</th>\n",
       "      <td>3205</td>\n",
       "      <td>皮衣</td>\n",
       "      <td>22:00</td>\n",
       "      <td>0.012876</td>\n",
       "      <td>hour</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>681</th>\n",
       "      <td>3205</td>\n",
       "      <td>皮衣</td>\n",
       "      <td>23:00</td>\n",
       "      <td>0.024034</td>\n",
       "      <td>hour</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>682 rows × 5 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "     行业id 行业名称   name        占比  type\n",
       "0    1698  连衣裙     周日  0.099072  week\n",
       "1    1698  连衣裙     周一  0.180806  week\n",
       "2    1698  连衣裙     周二  0.186982  week\n",
       "3    1698  连衣裙     周三  0.196898  week\n",
       "4    1698  连衣裙     周四  0.102349  week\n",
       "..    ...  ...    ...       ...   ...\n",
       "677  3205   皮衣  19:00  0.046352  hour\n",
       "678  3205   皮衣  20:00  0.056652  hour\n",
       "679  3205   皮衣  21:00  0.033476  hour\n",
       "680  3205   皮衣  22:00  0.012876  hour\n",
       "681  3205   皮衣  23:00  0.024034  hour\n",
       "\n",
       "[682 rows x 5 columns]"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 导入数据文件\n",
    "df3=pd.read_excel('服饰行业粉丝活跃时间分布.xlsx')\n",
    "df3"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {
    "scrolled": false
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>行业id</th>\n",
       "      <th>行业名称</th>\n",
       "      <th>name</th>\n",
       "      <th>占比</th>\n",
       "      <th>type</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1698</td>\n",
       "      <td>连衣裙</td>\n",
       "      <td>周日</td>\n",
       "      <td>0.099072</td>\n",
       "      <td>week</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1698</td>\n",
       "      <td>连衣裙</td>\n",
       "      <td>周一</td>\n",
       "      <td>0.180806</td>\n",
       "      <td>week</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>1698</td>\n",
       "      <td>连衣裙</td>\n",
       "      <td>周二</td>\n",
       "      <td>0.186982</td>\n",
       "      <td>week</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>1698</td>\n",
       "      <td>连衣裙</td>\n",
       "      <td>周三</td>\n",
       "      <td>0.196898</td>\n",
       "      <td>week</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>1698</td>\n",
       "      <td>连衣裙</td>\n",
       "      <td>周四</td>\n",
       "      <td>0.102349</td>\n",
       "      <td>week</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>653</th>\n",
       "      <td>3205</td>\n",
       "      <td>皮衣</td>\n",
       "      <td>周二</td>\n",
       "      <td>0.074678</td>\n",
       "      <td>week</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>654</th>\n",
       "      <td>3205</td>\n",
       "      <td>皮衣</td>\n",
       "      <td>周三</td>\n",
       "      <td>0.132189</td>\n",
       "      <td>week</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>655</th>\n",
       "      <td>3205</td>\n",
       "      <td>皮衣</td>\n",
       "      <td>周四</td>\n",
       "      <td>0.064378</td>\n",
       "      <td>week</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>656</th>\n",
       "      <td>3205</td>\n",
       "      <td>皮衣</td>\n",
       "      <td>周五</td>\n",
       "      <td>0.058369</td>\n",
       "      <td>week</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>657</th>\n",
       "      <td>3205</td>\n",
       "      <td>皮衣</td>\n",
       "      <td>周六</td>\n",
       "      <td>0.465236</td>\n",
       "      <td>week</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>154 rows × 5 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "     行业id 行业名称 name        占比  type\n",
       "0    1698  连衣裙   周日  0.099072  week\n",
       "1    1698  连衣裙   周一  0.180806  week\n",
       "2    1698  连衣裙   周二  0.186982  week\n",
       "3    1698  连衣裙   周三  0.196898  week\n",
       "4    1698  连衣裙   周四  0.102349  week\n",
       "..    ...  ...  ...       ...   ...\n",
       "653  3205   皮衣   周二  0.074678  week\n",
       "654  3205   皮衣   周三  0.132189  week\n",
       "655  3205   皮衣   周四  0.064378  week\n",
       "656  3205   皮衣   周五  0.058369  week\n",
       "657  3205   皮衣   周六  0.465236  week\n",
       "\n",
       "[154 rows x 5 columns]"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#先筛选出周数据\n",
    "df3_week=df3[df3['type']=='week']\n",
    "df3_week"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>name</th>\n",
       "      <th>占比</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>周一</td>\n",
       "      <td>0.152279</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>周三</td>\n",
       "      <td>0.190089</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>周二</td>\n",
       "      <td>0.153936</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>周五</td>\n",
       "      <td>0.135889</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>周六</td>\n",
       "      <td>0.146600</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>周四</td>\n",
       "      <td>0.121409</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>周日</td>\n",
       "      <td>0.099798</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "  name        占比\n",
       "0   周一  0.152279\n",
       "1   周三  0.190089\n",
       "2   周二  0.153936\n",
       "3   周五  0.135889\n",
       "4   周六  0.146600\n",
       "5   周四  0.121409\n",
       "6   周日  0.099798"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#汇总不同品类同一天的占比平均值\n",
    "active_week=df3_week.groupby('name')['占比'].mean().reset_index()\n",
    "active_week"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0    周一\n",
       "1    周三\n",
       "2    周二\n",
       "3    周五\n",
       "4    周六\n",
       "5    周四\n",
       "6    周日\n",
       "Name: name, dtype: object"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "active_week['name']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0    0.1523\n",
       "1    0.1901\n",
       "2    0.1539\n",
       "3    0.1359\n",
       "4    0.1466\n",
       "5    0.1214\n",
       "6    0.0998\n",
       "Name: 占比, dtype: float64"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "active_week['占比']=round(active_week['占比'],4)  #round()四舍五入保留四位小数\n",
    "active_week['占比']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [],
   "source": [
    "#同理，以上面数据处理的方法汇总一天不同小时的类目占比\n",
    "#先筛选出小时数据\n",
    "df3_hour=df3[df3['type']=='hour']\n",
    "#汇总不同品类同一天的占比平均值\n",
    "active_hour=df3_hour.groupby('name')['占比'].mean().reset_index()\n",
    "#round()四舍五入保留四位小数\n",
    "active_hour['占比']=round(active_hour['占比'],4)  "
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### 2.数据可视化"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts':'http://localhost:8888/nbextensions/assets/echarts.min'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "\n",
       "    <style>\n",
       "        .tab {\n",
       "            overflow: hidden;\n",
       "            border: 1px solid #ccc;\n",
       "            background-color: #f1f1f1;\n",
       "        }\n",
       "\n",
       "        .tab button {\n",
       "            background-color: inherit;\n",
       "            float: left;\n",
       "            border: none;\n",
       "            outline: none;\n",
       "            cursor: pointer;\n",
       "            padding: 12px 16px;\n",
       "            transition: 0.3s;\n",
       "        }\n",
       "\n",
       "        .tab button:hover {\n",
       "            background-color: #ddd;\n",
       "        }\n",
       "\n",
       "        .tab button.active {\n",
       "            background-color: #ccc;\n",
       "        }\n",
       "\n",
       "        .chart-container {\n",
       "            display: none;\n",
       "            padding: 6px 12px;\n",
       "            border-top: none;\n",
       "        }\n",
       "    </style>\n",
       "<div class=\"tab\">\n",
       "            <button class=\"tablinks\" onclick=\"showChart(event, '13966527e6f3448ead3a02a48c490b5b')\">粉丝活跃时间_周</button>\n",
       "            <button class=\"tablinks\" onclick=\"showChart(event, '28206df8482b4918b10d34a20fa6fa1b')\">粉丝活跃时间_小时</button>\n",
       "    </div>\n",
       "\n",
       "        <div id=\"13966527e6f3448ead3a02a48c490b5b\" class=\"chart-container\" style=\"width:900px; height:500px;\"></div>\n",
       "        <div id=\"28206df8482b4918b10d34a20fa6fa1b\" class=\"chart-container\" style=\"width:900px; height:500px;\"></div>\n",
       "\n",
       "<script>\n",
       "        require(['echarts'], function(echarts) {\n",
       "                var chart_13966527e6f3448ead3a02a48c490b5b = echarts.init(\n",
       "                    document.getElementById('13966527e6f3448ead3a02a48c490b5b'), 'white', {renderer: 'canvas'});\n",
       "                var option_13966527e6f3448ead3a02a48c490b5b = {\n",
       "    \"animation\": true,\n",
       "    \"animationThreshold\": 2000,\n",
       "    \"animationDuration\": 1000,\n",
       "    \"animationEasing\": \"cubicOut\",\n",
       "    \"animationDelay\": 0,\n",
       "    \"animationDurationUpdate\": 300,\n",
       "    \"animationEasingUpdate\": \"cubicOut\",\n",
       "    \"animationDelayUpdate\": 0,\n",
       "    \"color\": [\n",
       "        \"#c23531\",\n",
       "        \"#2f4554\",\n",
       "        \"#61a0a8\",\n",
       "        \"#d48265\",\n",
       "        \"#749f83\",\n",
       "        \"#ca8622\",\n",
       "        \"#bda29a\",\n",
       "        \"#6e7074\",\n",
       "        \"#546570\",\n",
       "        \"#c4ccd3\",\n",
       "        \"#f05b72\",\n",
       "        \"#ef5b9c\",\n",
       "        \"#f47920\",\n",
       "        \"#905a3d\",\n",
       "        \"#fab27b\",\n",
       "        \"#2a5caa\",\n",
       "        \"#444693\",\n",
       "        \"#726930\",\n",
       "        \"#b2d235\",\n",
       "        \"#6d8346\",\n",
       "        \"#ac6767\",\n",
       "        \"#1d953f\",\n",
       "        \"#6950a1\",\n",
       "        \"#918597\"\n",
       "    ],\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"line\",\n",
       "            \"name\": \"\\u6d3b\\u8dc3\\u5ea6\",\n",
       "            \"connectNulls\": false,\n",
       "            \"symbolSize\": 4,\n",
       "            \"showSymbol\": true,\n",
       "            \"smooth\": false,\n",
       "            \"clip\": true,\n",
       "            \"step\": false,\n",
       "            \"data\": [\n",
       "                [\n",
       "                    \"\\u5468\\u4e00\",\n",
       "                    0.1523\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u5468\\u4e09\",\n",
       "                    0.1901\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u5468\\u4e8c\",\n",
       "                    0.1539\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u5468\\u4e94\",\n",
       "                    0.1359\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u5468\\u516d\",\n",
       "                    0.1466\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u5468\\u56db\",\n",
       "                    0.1214\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u5468\\u65e5\",\n",
       "                    0.0998\n",
       "                ]\n",
       "            ],\n",
       "            \"hoverAnimation\": true,\n",
       "            \"label\": {\n",
       "                \"show\": true,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8\n",
       "            },\n",
       "            \"lineStyle\": {\n",
       "                \"show\": true,\n",
       "                \"width\": 1,\n",
       "                \"opacity\": 1,\n",
       "                \"curveness\": 0,\n",
       "                \"type\": \"solid\"\n",
       "            },\n",
       "            \"areaStyle\": {\n",
       "                \"opacity\": 0\n",
       "            },\n",
       "            \"markPoint\": {\n",
       "                \"label\": {\n",
       "                    \"show\": true,\n",
       "                    \"position\": \"inside\",\n",
       "                    \"color\": \"#fff\",\n",
       "                    \"margin\": 8\n",
       "                },\n",
       "                \"data\": [\n",
       "                    {\n",
       "                        \"type\": \"max\"\n",
       "                    }\n",
       "                ]\n",
       "            },\n",
       "            \"zlevel\": 0,\n",
       "            \"z\": 0\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"\\u6d3b\\u8dc3\\u5ea6\"\n",
       "            ],\n",
       "            \"selected\": {\n",
       "                \"\\u6d3b\\u8dc3\\u5ea6\": true\n",
       "            },\n",
       "            \"show\": true,\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10,\n",
       "            \"itemWidth\": 25,\n",
       "            \"itemHeight\": 14\n",
       "        }\n",
       "    ],\n",
       "    \"tooltip\": {\n",
       "        \"show\": true,\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"showContent\": true,\n",
       "        \"alwaysShowContent\": false,\n",
       "        \"showDelay\": 0,\n",
       "        \"hideDelay\": 100,\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"borderWidth\": 0,\n",
       "        \"padding\": 5\n",
       "    },\n",
       "    \"xAxis\": [\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 0,\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": false,\n",
       "                \"lineStyle\": {\n",
       "                    \"show\": true,\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            },\n",
       "            \"data\": [\n",
       "                \"\\u5468\\u4e00\",\n",
       "                \"\\u5468\\u4e09\",\n",
       "                \"\\u5468\\u4e8c\",\n",
       "                \"\\u5468\\u4e94\",\n",
       "                \"\\u5468\\u516d\",\n",
       "                \"\\u5468\\u56db\",\n",
       "                \"\\u5468\\u65e5\"\n",
       "            ]\n",
       "        }\n",
       "    ],\n",
       "    \"yAxis\": [\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 0,\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": false,\n",
       "                \"lineStyle\": {\n",
       "                    \"show\": true,\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"title\": [\n",
       "        {\n",
       "            \"text\": \"\\u7c89\\u4e1d\\u6d3b\\u8dc3\\u65f6\\u95f4\\u2014\\u5468\",\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10\n",
       "        }\n",
       "    ],\n",
       "    \"dataZoom\": [\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"type\": \"slider\",\n",
       "            \"realtime\": true,\n",
       "            \"start\": 20,\n",
       "            \"end\": 80,\n",
       "            \"orient\": \"horizontal\",\n",
       "            \"zoomLock\": false,\n",
       "            \"filterMode\": \"filter\"\n",
       "        }\n",
       "    ]\n",
       "};\n",
       "                chart_13966527e6f3448ead3a02a48c490b5b.setOption(option_13966527e6f3448ead3a02a48c490b5b);\n",
       "                var chart_28206df8482b4918b10d34a20fa6fa1b = echarts.init(\n",
       "                    document.getElementById('28206df8482b4918b10d34a20fa6fa1b'), 'white', {renderer: 'canvas'});\n",
       "                var option_28206df8482b4918b10d34a20fa6fa1b = {\n",
       "    \"animation\": true,\n",
       "    \"animationThreshold\": 2000,\n",
       "    \"animationDuration\": 1000,\n",
       "    \"animationEasing\": \"cubicOut\",\n",
       "    \"animationDelay\": 0,\n",
       "    \"animationDurationUpdate\": 300,\n",
       "    \"animationEasingUpdate\": \"cubicOut\",\n",
       "    \"animationDelayUpdate\": 0,\n",
       "    \"color\": [\n",
       "        \"#c23531\",\n",
       "        \"#2f4554\",\n",
       "        \"#61a0a8\",\n",
       "        \"#d48265\",\n",
       "        \"#749f83\",\n",
       "        \"#ca8622\",\n",
       "        \"#bda29a\",\n",
       "        \"#6e7074\",\n",
       "        \"#546570\",\n",
       "        \"#c4ccd3\",\n",
       "        \"#f05b72\",\n",
       "        \"#ef5b9c\",\n",
       "        \"#f47920\",\n",
       "        \"#905a3d\",\n",
       "        \"#fab27b\",\n",
       "        \"#2a5caa\",\n",
       "        \"#444693\",\n",
       "        \"#726930\",\n",
       "        \"#b2d235\",\n",
       "        \"#6d8346\",\n",
       "        \"#ac6767\",\n",
       "        \"#1d953f\",\n",
       "        \"#6950a1\",\n",
       "        \"#918597\"\n",
       "    ],\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"line\",\n",
       "            \"name\": \"\\u6d3b\\u8dc3\\u5ea6\",\n",
       "            \"connectNulls\": false,\n",
       "            \"symbolSize\": 4,\n",
       "            \"showSymbol\": true,\n",
       "            \"smooth\": false,\n",
       "            \"clip\": true,\n",
       "            \"step\": false,\n",
       "            \"data\": [\n",
       "                [\n",
       "                    \"00:00\",\n",
       "                    0.0311\n",
       "                ],\n",
       "                [\n",
       "                    \"01:00\",\n",
       "                    0.0125\n",
       "                ],\n",
       "                [\n",
       "                    \"02:00\",\n",
       "                    0.006\n",
       "                ],\n",
       "                [\n",
       "                    \"03:00\",\n",
       "                    0.0024\n",
       "                ],\n",
       "                [\n",
       "                    \"04:00\",\n",
       "                    0.0023\n",
       "                ],\n",
       "                [\n",
       "                    \"05:00\",\n",
       "                    0.0028\n",
       "                ],\n",
       "                [\n",
       "                    \"06:00\",\n",
       "                    0.0062\n",
       "                ],\n",
       "                [\n",
       "                    \"07:00\",\n",
       "                    0.0131\n",
       "                ],\n",
       "                [\n",
       "                    \"08:00\",\n",
       "                    0.0323\n",
       "                ],\n",
       "                [\n",
       "                    \"09:00\",\n",
       "                    0.0337\n",
       "                ],\n",
       "                [\n",
       "                    \"10:00\",\n",
       "                    0.0404\n",
       "                ],\n",
       "                [\n",
       "                    \"11:00\",\n",
       "                    0.0495\n",
       "                ],\n",
       "                [\n",
       "                    \"12:00\",\n",
       "                    0.0645\n",
       "                ],\n",
       "                [\n",
       "                    \"13:00\",\n",
       "                    0.0566\n",
       "                ],\n",
       "                [\n",
       "                    \"14:00\",\n",
       "                    0.0492\n",
       "                ],\n",
       "                [\n",
       "                    \"15:00\",\n",
       "                    0.0481\n",
       "                ],\n",
       "                [\n",
       "                    \"16:00\",\n",
       "                    0.0522\n",
       "                ],\n",
       "                [\n",
       "                    \"17:00\",\n",
       "                    0.0631\n",
       "                ],\n",
       "                [\n",
       "                    \"18:00\",\n",
       "                    0.0769\n",
       "                ],\n",
       "                [\n",
       "                    \"19:00\",\n",
       "                    0.0831\n",
       "                ],\n",
       "                [\n",
       "                    \"20:00\",\n",
       "                    0.0756\n",
       "                ],\n",
       "                [\n",
       "                    \"21:00\",\n",
       "                    0.0706\n",
       "                ],\n",
       "                [\n",
       "                    \"22:00\",\n",
       "                    0.0717\n",
       "                ],\n",
       "                [\n",
       "                    \"23:00\",\n",
       "                    0.056\n",
       "                ]\n",
       "            ],\n",
       "            \"hoverAnimation\": true,\n",
       "            \"label\": {\n",
       "                \"show\": true,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8\n",
       "            },\n",
       "            \"lineStyle\": {\n",
       "                \"show\": true,\n",
       "                \"width\": 1,\n",
       "                \"opacity\": 1,\n",
       "                \"curveness\": 0,\n",
       "                \"type\": \"solid\"\n",
       "            },\n",
       "            \"areaStyle\": {\n",
       "                \"opacity\": 0\n",
       "            },\n",
       "            \"markPoint\": {\n",
       "                \"label\": {\n",
       "                    \"show\": true,\n",
       "                    \"position\": \"inside\",\n",
       "                    \"color\": \"#fff\",\n",
       "                    \"margin\": 8\n",
       "                },\n",
       "                \"data\": [\n",
       "                    {\n",
       "                        \"type\": \"max\"\n",
       "                    }\n",
       "                ]\n",
       "            },\n",
       "            \"zlevel\": 0,\n",
       "            \"z\": 0\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"\\u6d3b\\u8dc3\\u5ea6\"\n",
       "            ],\n",
       "            \"selected\": {\n",
       "                \"\\u6d3b\\u8dc3\\u5ea6\": true\n",
       "            },\n",
       "            \"show\": true,\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10,\n",
       "            \"itemWidth\": 25,\n",
       "            \"itemHeight\": 14\n",
       "        }\n",
       "    ],\n",
       "    \"tooltip\": {\n",
       "        \"show\": true,\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"showContent\": true,\n",
       "        \"alwaysShowContent\": false,\n",
       "        \"showDelay\": 0,\n",
       "        \"hideDelay\": 100,\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"borderWidth\": 0,\n",
       "        \"padding\": 5\n",
       "    },\n",
       "    \"xAxis\": [\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 0,\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": false,\n",
       "                \"lineStyle\": {\n",
       "                    \"show\": true,\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            },\n",
       "            \"data\": [\n",
       "                \"00:00\",\n",
       "                \"01:00\",\n",
       "                \"02:00\",\n",
       "                \"03:00\",\n",
       "                \"04:00\",\n",
       "                \"05:00\",\n",
       "                \"06:00\",\n",
       "                \"07:00\",\n",
       "                \"08:00\",\n",
       "                \"09:00\",\n",
       "                \"10:00\",\n",
       "                \"11:00\",\n",
       "                \"12:00\",\n",
       "                \"13:00\",\n",
       "                \"14:00\",\n",
       "                \"15:00\",\n",
       "                \"16:00\",\n",
       "                \"17:00\",\n",
       "                \"18:00\",\n",
       "                \"19:00\",\n",
       "                \"20:00\",\n",
       "                \"21:00\",\n",
       "                \"22:00\",\n",
       "                \"23:00\"\n",
       "            ]\n",
       "        }\n",
       "    ],\n",
       "    \"yAxis\": [\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 0,\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": false,\n",
       "                \"lineStyle\": {\n",
       "                    \"show\": true,\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"title\": [\n",
       "        {\n",
       "            \"text\": \"\\u7c89\\u4e1d\\u6d3b\\u8dc3\\u65f6\\u95f4_\\u5c0f\\u65f6\",\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10\n",
       "        }\n",
       "    ],\n",
       "    \"dataZoom\": [\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"type\": \"slider\",\n",
       "            \"realtime\": true,\n",
       "            \"start\": 20,\n",
       "            \"end\": 80,\n",
       "            \"orient\": \"horizontal\",\n",
       "            \"zoomLock\": false,\n",
       "            \"filterMode\": \"filter\"\n",
       "        }\n",
       "    ]\n",
       "};\n",
       "                chart_28206df8482b4918b10d34a20fa6fa1b.setOption(option_28206df8482b4918b10d34a20fa6fa1b);\n",
       "        });\n",
       "    </script>\n",
       "<script>\n",
       "        (function() {\n",
       "            containers = document.getElementsByClassName(\"chart-container\");\n",
       "            if(containers.length > 0) {\n",
       "                containers[0].style.display = \"block\";\n",
       "            }\n",
       "        })()\n",
       "\n",
       "        function showChart(evt, chartID) {\n",
       "            let containers = document.getElementsByClassName(\"chart-container\");\n",
       "            for (let i = 0; i < containers.length; i++) {\n",
       "                containers[i].style.display = \"none\";\n",
       "            }\n",
       "\n",
       "            let tablinks = document.getElementsByClassName(\"tablinks\");\n",
       "            for (let i = 0; i < tablinks.length; i++) {\n",
       "                tablinks[i].className = \"tablinks\";\n",
       "            }\n",
       "\n",
       "            document.getElementById(chartID).style.display = \"block\";\n",
       "            evt.currentTarget.className += \" active\";\n",
       "        }\n",
       "    </script>\n"
      ],
      "text/plain": [
       "<pyecharts.render.display.HTML at 0x1e5d02077c0>"
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 处理好数据后作Tab图：https://gallery.pyecharts.org/#/Tab/tab_base\n",
    "from pyecharts import options as opts\n",
    "from pyecharts.charts import Bar, Grid, Line, Pie, Tab\n",
    "\n",
    "x_data_week = active_week['name'].tolist()\n",
    "y_data_week = active_week['占比'].tolist()\n",
    "x_data_hour = active_hour['name'].tolist()\n",
    "y_data_hour = active_hour['占比'].tolist()\n",
    "\n",
    "def fan_week() -> Line:\n",
    "    w = (\n",
    "        Line()\n",
    "        .add_xaxis(x_data_week)\n",
    "        .add_yaxis(\n",
    "            \"活跃度\",\n",
    "            y_data_week,\n",
    "            markpoint_opts=opts.MarkPointOpts(data=[opts.MarkPointItem(type_=\"max\")]),\n",
    "        )\n",
    "        .set_global_opts(\n",
    "            title_opts=opts.TitleOpts(title=\"粉丝活跃时间—周\"),\n",
    "            datazoom_opts=[opts.DataZoomOpts()],\n",
    "        )\n",
    "    )\n",
    "    return w\n",
    "\n",
    "def fan_hour() -> Line:\n",
    "    h = (\n",
    "        Line()\n",
    "        .add_xaxis(x_data_hour)\n",
    "        .add_yaxis(\n",
    "            \"活跃度\",\n",
    "            y_data_hour,\n",
    "            markpoint_opts=opts.MarkPointOpts(data=[opts.MarkPointItem(type_=\"max\")]),\n",
    "        )\n",
    "        .set_global_opts(\n",
    "            title_opts=opts.TitleOpts(title=\"粉丝活跃时间_小时\"),\n",
    "            datazoom_opts=[opts.DataZoomOpts()],\n",
    "        )\n",
    "    )\n",
    "    return h\n",
    "\n",
    "\n",
    "\n",
    "tab = Tab()\n",
    "tab.add(fan_week(), \"粉丝活跃时间_周\")\n",
    "tab.add(fan_hour(), \"粉丝活跃时间_小时\")\n",
    "tab.render_notebook()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "粉丝周三最活跃，中午休息时间有一个小高峰，晚上17点到23点是粉丝活跃时间段，小红书粉丝的活跃时间比较符合一般人们的作息时间"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 粉丝关注焦点-词云图"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### 数据处理"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>行业id</th>\n",
       "      <th>行业名称</th>\n",
       "      <th>标签</th>\n",
       "      <th>占比</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1698</td>\n",
       "      <td>连衣裙</td>\n",
       "      <td>彩妆</td>\n",
       "      <td>7.33</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1698</td>\n",
       "      <td>连衣裙</td>\n",
       "      <td>穿搭</td>\n",
       "      <td>6.53</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>1698</td>\n",
       "      <td>连衣裙</td>\n",
       "      <td>发型</td>\n",
       "      <td>3.86</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>1698</td>\n",
       "      <td>连衣裙</td>\n",
       "      <td>护肤</td>\n",
       "      <td>3.53</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>1698</td>\n",
       "      <td>连衣裙</td>\n",
       "      <td>减肥运动</td>\n",
       "      <td>3.42</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6681</th>\n",
       "      <td>3205</td>\n",
       "      <td>皮衣</td>\n",
       "      <td>婚嫁</td>\n",
       "      <td>0.05</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6682</th>\n",
       "      <td>3205</td>\n",
       "      <td>皮衣</td>\n",
       "      <td>婚礼造型</td>\n",
       "      <td>0.05</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6683</th>\n",
       "      <td>3205</td>\n",
       "      <td>皮衣</td>\n",
       "      <td>婴童服装</td>\n",
       "      <td>0.05</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6684</th>\n",
       "      <td>3205</td>\n",
       "      <td>皮衣</td>\n",
       "      <td>综艺（图文）</td>\n",
       "      <td>0.05</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6685</th>\n",
       "      <td>3205</td>\n",
       "      <td>皮衣</td>\n",
       "      <td>婴童用品</td>\n",
       "      <td>0.05</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>6686 rows × 4 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "      行业id 行业名称      标签    占比\n",
       "0     1698  连衣裙      彩妆  7.33\n",
       "1     1698  连衣裙      穿搭  6.53\n",
       "2     1698  连衣裙      发型  3.86\n",
       "3     1698  连衣裙      护肤  3.53\n",
       "4     1698  连衣裙    减肥运动  3.42\n",
       "...    ...  ...     ...   ...\n",
       "6681  3205   皮衣      婚嫁  0.05\n",
       "6682  3205   皮衣    婚礼造型  0.05\n",
       "6683  3205   皮衣    婴童服装  0.05\n",
       "6684  3205   皮衣  综艺（图文）  0.05\n",
       "6685  3205   皮衣    婴童用品  0.05\n",
       "\n",
       "[6686 rows x 4 columns]"
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 导入数据文件\n",
    "df4=pd.read_excel('服饰行业粉丝关注焦点.xlsx')\n",
    "df4"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>标签</th>\n",
       "      <th>占比</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>188男团</td>\n",
       "      <td>0.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2020年第一个Vlog</td>\n",
       "      <td>0.01</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>2022冰雪之约</td>\n",
       "      <td>0.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>3ce怎么样</td>\n",
       "      <td>0.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>441B.W.攻略</td>\n",
       "      <td>0.01</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>982</th>\n",
       "      <td>麦片</td>\n",
       "      <td>0.03</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>983</th>\n",
       "      <td>麻辣香锅</td>\n",
       "      <td>0.01</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>984</th>\n",
       "      <td>黄夏温</td>\n",
       "      <td>0.01</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>985</th>\n",
       "      <td>黑吕</td>\n",
       "      <td>0.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>986</th>\n",
       "      <td>黑客</td>\n",
       "      <td>0.00</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>987 rows × 2 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "               标签    占比\n",
       "0           188男团  0.00\n",
       "1    2020年第一个Vlog  0.01\n",
       "2        2022冰雪之约  0.00\n",
       "3          3ce怎么样  0.00\n",
       "4       441B.W.攻略  0.01\n",
       "..            ...   ...\n",
       "982            麦片  0.03\n",
       "983          麻辣香锅  0.01\n",
       "984           黄夏温  0.01\n",
       "985            黑吕  0.00\n",
       "986            黑客  0.00\n",
       "\n",
       "[987 rows x 2 columns]"
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_fans = df4.groupby(['标签']).agg({'占比': 'sum'}).reset_index()\n",
    "df_fans"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[('188男团', 0.0),\n",
       " ('2020年第一个Vlog', 0.01),\n",
       " ('2022冰雪之约', 0.0),\n",
       " ('3ce怎么样', 0.0),\n",
       " ('441B.W.攻略', 0.01),\n",
       " ('AR猪猪拜年', 0.0),\n",
       " ('K家', 0.0),\n",
       " ('TFBOYS六周年演唱会', 0.02),\n",
       " ('Vapiano攻略', 0.01),\n",
       " ('Vlog我的宠物日常', 0.07),\n",
       " ('absolute怎么样', 0.0),\n",
       " ('airbnb怎么样', 0.0),\n",
       " ('aritzia怎么样', 0.0),\n",
       " ('bell怎么样', 0.0),\n",
       " ('blackpink', 0.07),\n",
       " ('canada goose怎么样', 0.01),\n",
       " ('cc霜', 0.0),\n",
       " ('chapter怎么样', 0.0),\n",
       " ('coco怎么样', 0.0),\n",
       " ('cos怎么样', 0.0),\n",
       " ('cpb高光', 0.0),\n",
       " ('crane怎么样', 0.0),\n",
       " ('dha', 0.0),\n",
       " ('double wear', 0.0),\n",
       " ('epa', 0.0),\n",
       " ('essence怎么样', 0.0),\n",
       " ('evening怎么样', 0.0),\n",
       " ('exo', 0.0),\n",
       " ('fantopia2020', 0.0),\n",
       " ('gre', 0.0),\n",
       " ('hiphop', 0.0),\n",
       " ('inxx怎么样', 0.0),\n",
       " ('justin bieber', 0.0),\n",
       " ('k12教育', 0.7100000000000002),\n",
       " ('kfc怎么样', 0.0),\n",
       " ('labo labo', 0.0),\n",
       " ('lamente怎么样', 0.0),\n",
       " ('lucia tacci怎么样', 0.01),\n",
       " ('lytess怎么样', 0.02),\n",
       " ('maeil怎么样', 0.0),\n",
       " ('marni怎么样', 0.0),\n",
       " ('meme', 0.0),\n",
       " ('mustang怎么样', 0.0),\n",
       " ('native怎么样', 0.0),\n",
       " ('neighborhood怎么样', 0.01),\n",
       " ('nude怎么样', 0.0),\n",
       " ('only怎么样', 0.0),\n",
       " ('o型腿', 0.0),\n",
       " ('picsart怎么样', 0.0),\n",
       " ('pitera', 0.0),\n",
       " ('sk-ii怎么样', 0.0),\n",
       " ('switch游戏', 0.0),\n",
       " ('tfboys', 0.01),\n",
       " ('this works怎么样', 0.0),\n",
       " ('urban outfitters怎么样', 0.02),\n",
       " ('vdl怎么样', 0.0),\n",
       " ('whoo后', 0.0),\n",
       " ('。', 0.0),\n",
       " ('一人一句周杰伦', 0.0),\n",
       " ('一起读绘本', 0.0),\n",
       " ('七夕去哪玩', 0.01),\n",
       " ('三亚海棠湾', 0.0),\n",
       " ('上色', 0.0),\n",
       " ('上衣', 0.0),\n",
       " ('不做美甲不过冬', 0.0),\n",
       " ('不如跳舞', 0.0),\n",
       " ('东方神怎么样', 0.01),\n",
       " ('东方美食生活家李子柒', 0.01),\n",
       " ('丝塔芙怎么样', 0.0),\n",
       " ('两性', 13.350000000000003),\n",
       " ('个人', 0.7400000000000002),\n",
       " ('个人护理', 32.38999999999999),\n",
       " ('中医', 0.0),\n",
       " ('中外生活', 0.08),\n",
       " ('中学教育', 7.0600000000000005),\n",
       " ('串串香', 0.0),\n",
       " ('临摹', 0.02),\n",
       " ('主机游戏', 2.13),\n",
       " ('乐队', 0.0),\n",
       " ('书法', 2.0900000000000003),\n",
       " ('书签', 0.01),\n",
       " ('买了不后悔的家居神器', 0.0),\n",
       " ('乳液', 0.01),\n",
       " ('乳液面霜', 0.0),\n",
       " ('乳胶漆', 0.0),\n",
       " ('二沙岛', 0.0),\n",
       " ('五一去哪玩', 0.0),\n",
       " ('五色眼影', 0.0),\n",
       " ('亚麻灰', 0.0),\n",
       " ('产后修复', 0.0),\n",
       " ('产后恢复', 0.0),\n",
       " ('产后恢复这样做', 0.0),\n",
       " ('产后脱发', 0.0),\n",
       " ('产妇', 0.0),\n",
       " ('产检', 0.0),\n",
       " ('京东', 0.0),\n",
       " ('京润珍珠怎么样', 0.01),\n",
       " ('京都', 0.0),\n",
       " ('人文', 3.9299999999999997),\n",
       " ('人文风光展示', 1.5400000000000003),\n",
       " ('今日壁纸', 0.0),\n",
       " ('介绍一个小哥哥', 0.0),\n",
       " ('代谢', 0.0),\n",
       " ('以纯怎么样', 0.0),\n",
       " ('伊思怎么样', 0.0),\n",
       " ('伊欧诗怎么样', 0.0),\n",
       " ('伊索怎么样', 0.0),\n",
       " ('伊蒂之屋怎么样', 0.0),\n",
       " ('休闲娱乐场所', 3.0900000000000003),\n",
       " ('休闲娱乐攻略', 0.0),\n",
       " ('优梵艺术怎么样', 0.0),\n",
       " ('优酷怎么样', 0.01),\n",
       " ('传统景点攻略', 0.21),\n",
       " ('伴手礼', 0.0),\n",
       " ('佐料', 1.1700000000000006),\n",
       " ('体寒', 0.01),\n",
       " ('体育运动', 1.1900000000000004),\n",
       " ('体香', 0.0),\n",
       " ('作死', 0.0),\n",
       " ('使用技巧', 9.159999999999998),\n",
       " ('保健品', 3.24),\n",
       " ('保温杯', 0.01),\n",
       " ('保湿修复', 0.0),\n",
       " ('保湿霜', 0.0),\n",
       " ('借钱', 0.02),\n",
       " ('假期宅在家', 0.01),\n",
       " ('做个养生girl', 0.05),\n",
       " ('健康知识科普', 0.01),\n",
       " ('健身', 56.16),\n",
       " ('健身减肥', 2.4400000000000004),\n",
       " ('健身前后大对比', 0.0),\n",
       " ('健身塑型', 0.7700000000000002),\n",
       " ('健身教练', 0.01),\n",
       " ('健身装备', 0.0),\n",
       " ('偶像练习生', 0.25000000000000006),\n",
       " ('儿童房', 0.0),\n",
       " ('克莱因蓝', 0.01),\n",
       " ('免税店', 0.0),\n",
       " ('全家怎么样', 0.05),\n",
       " ('全棉时代怎么样', 0.0),\n",
       " ('公交车', 0.0),\n",
       " ('共享单车', 0.01),\n",
       " ('关键词', 0.01),\n",
       " ('兴趣爱好', 7.300000000000001),\n",
       " ('兴趣爱好其他', 0.6700000000000002),\n",
       " ('其他', 12.290000000000001),\n",
       " ('其他攻略', 0.0),\n",
       " ('其他知识', 0.08),\n",
       " ('其他赛事', 0.21000000000000002),\n",
       " ('养生粥', 0.0),\n",
       " ('养生食疗', 12.079999999999998),\n",
       " ('内卷', 0.01),\n",
       " ('写作', 0.0),\n",
       " ('写真', 8.4),\n",
       " ('冬天去哪玩', 0.10999999999999999),\n",
       " ('冲浪', 0.01),\n",
       " ('凉菜', 0.0),\n",
       " ('减肥', 4.7),\n",
       " ('减肥其他', 1.0900000000000003),\n",
       " ('减肥减脂吃这些', 0.01),\n",
       " ('减肥医药', 1.02),\n",
       " ('减肥场所', 0.05),\n",
       " ('减肥打卡', 0.060000000000000005),\n",
       " ('减肥是女人一生的事业', 0.0),\n",
       " ('减肥经验', 13.979999999999999),\n",
       " ('减肥运动', 74.49000000000002),\n",
       " ('减肥餐', 0.05),\n",
       " ('减肥餐教程', 0.8500000000000001),\n",
       " ('减肥饮食', 19.919999999999998),\n",
       " ('减脂', 0.01),\n",
       " ('凹凸世界', 0.0),\n",
       " ('出游穿搭', 0.0),\n",
       " ('出行', 14.23),\n",
       " ('出行VLOG', 0.0),\n",
       " ('出行其他', 10.13),\n",
       " ('出行攻略', 3.67),\n",
       " ('出行用品', 3.2300000000000004),\n",
       " ('分享好生活', 0.02),\n",
       " ('刘亦菲', 0.07),\n",
       " ('刘海', 0.0),\n",
       " ('创可贴', 0.0),\n",
       " ('刺身', 0.0),\n",
       " ('动漫', 7.580000000000002),\n",
       " ('励志鸡汤', 2.1800000000000006),\n",
       " ('励志鸡汤句子', 0.0),\n",
       " ('包包', 0.0),\n",
       " ('化妆', 0.0),\n",
       " ('化妆品', 0.01),\n",
       " ('化妆教程', 0.0),\n",
       " ('北欧', 0.01),\n",
       " ('北欧表情家居怎么样', 0.0),\n",
       " ('北鼎怎么样', 0.0),\n",
       " ('医疗健康', 4.720000000000001),\n",
       " ('医疗健康其他', 9.360000000000001),\n",
       " ('医疗器械', 0.04),\n",
       " ('医疗方法', 3.7900000000000005),\n",
       " ('医疗药品', 4.319999999999999),\n",
       " ('医美', 0.01),\n",
       " ('医美整形', 5.620000000000001),\n",
       " ('十一去哪玩', 0.02),\n",
       " ('半身裙', 0.0),\n",
       " ('华伦天奴怎么样', 0.0),\n",
       " ('单肩包', 0.08),\n",
       " ('单身', 0.0),\n",
       " ('南昌', 0.0),\n",
       " ('卡姿兰怎么样', 0.01),\n",
       " ('卡尔顿怎么样', 0.0),\n",
       " ('卧室', 0.0),\n",
       " ('卧室装修灵感库', 0.02),\n",
       " ('卫衣', 0.0),\n",
       " ('卸妆洁面乳', 0.0),\n",
       " ('原液', 0.01),\n",
       " ('原耽', 0.0),\n",
       " ('去处', 25.909999999999997),\n",
       " ('去日本买什么', 0.0),\n",
       " ('又该减肥了', 0.0),\n",
       " ('双十一', 0.01),\n",
       " ('双十一去哪玩', 0.0),\n",
       " ('双眼皮贴', 0.0),\n",
       " ('双肩包', 0.01),\n",
       " ('发型', 76.52000000000001),\n",
       " ('发绳', 0.0),\n",
       " ('口感', 0.0),\n",
       " ('口红', 0.060000000000000005),\n",
       " ('口红包', 0.0),\n",
       " ('口罩', 0.01),\n",
       " ('古装好剧追不停', 0.0),\n",
       " ('可优比怎么样', 0.01),\n",
       " ('可瑞安怎么样', 0.0),\n",
       " ('吃播', 1.0000000000000002),\n",
       " ('吃货', 0.0),\n",
       " ('吃货在首尔', 0.01),\n",
       " ('合集类攻略', 0.05),\n",
       " ('启动仪式', 0.0),\n",
       " ('启蒙要趁澡', 0.01),\n",
       " ('吴世勋', 0.0),\n",
       " ('周末', 0.0),\n",
       " ('周末看综艺', 0.0),\n",
       " ('周末穿搭', 0.01),\n",
       " ('周深', 0.0),\n",
       " ('咖啡', 0.02),\n",
       " ('咖啡店', 0.0),\n",
       " ('咬唇妆', 0.0),\n",
       " ('品质生活', 0.07),\n",
       " ('哈姆雷特怎么样', 0.0),\n",
       " ('哑光', 0.0),\n",
       " ('唇毛', 0.0),\n",
       " ('唇釉', 0.0),\n",
       " ('唐人街探案2', 0.0),\n",
       " ('商业摄影', 0.01),\n",
       " ('商业财经', 3.2100000000000004),\n",
       " ('喂养工具', 0.01),\n",
       " ('嘉娜宝(久光百货店)', 0.0),\n",
       " ('回力怎么样', 0.0),\n",
       " ('国产好剧安利', 0.0),\n",
       " ('圆肩', 0.0),\n",
       " ('圣罗兰怎么样', 0.0),\n",
       " ('基金', 0.0),\n",
       " ('堆堆袜', 0.0),\n",
       " ('塑形', 0.0),\n",
       " ('塑身', 0.0),\n",
       " ('增高', 0.0),\n",
       " ('壁纸', 1.9500000000000006),\n",
       " ('备婚', 0.0),\n",
       " ('备孕', 0.0),\n",
       " ('备忘录', 0.0),\n",
       " ('备战雅思', 0.0),\n",
       " ('夏天去哪玩', 0.03),\n",
       " ('夏装', 0.01),\n",
       " ('外语教育', 11.290000000000001),\n",
       " ('外貌协会', 0.0),\n",
       " ('大众点评怎么样', 0.0),\n",
       " ('大创怎么样', 0.0),\n",
       " ('大学教育', 25.080000000000005),\n",
       " ('大学生', 0.0),\n",
       " ('大师粉底', 0.0),\n",
       " ('大无语事件发生', 0.0),\n",
       " ('大草原', 0.0),\n",
       " ('大长腿', 0.0),\n",
       " ('大阪旅行', 0.01),\n",
       " ('天府新区', 0.0),\n",
       " ('夫妻', 0.01),\n",
       " ('头像', 2.89),\n",
       " ('头发柔顺', 0.0),\n",
       " ('女明星', 0.02),\n",
       " ('女生发型参考', 0.0),\n",
       " ('女神粉底', 0.0),\n",
       " ('女装', 0.0),\n",
       " ('奶冻', 0.0),\n",
       " ('奶嘴', 0.0),\n",
       " ('奶瓶刷', 0.0),\n",
       " ('好习惯从小开始培养', 0.01),\n",
       " ('好习惯养成', 0.01),\n",
       " ('好物推荐', 0.32000000000000006),\n",
       " ('好物推荐--', 0.0),\n",
       " ('妈妈经验', 6.02),\n",
       " ('娇韵诗怎么样', 0.02),\n",
       " ('娱乐', 4.29),\n",
       " ('娱乐其他', 0.33000000000000007),\n",
       " ('娱乐圈', 0.0),\n",
       " ('娱乐圈热点追踪', 0.01),\n",
       " ('娱综评论', 0.02),\n",
       " ('婚嫁', 1.5800000000000003),\n",
       " ('婚嫁其他', 0.0),\n",
       " ('婚礼伴手礼', 0.01),\n",
       " ('婚礼场地', 0.02),\n",
       " ('婚礼用品', 1.8500000000000008),\n",
       " ('婚礼经验', 3.9600000000000004),\n",
       " ('婚礼记录', 3.02),\n",
       " ('婚礼造型', 3.2),\n",
       " ('婚纱', 0.0),\n",
       " ('婚纱照', 0.8500000000000003),\n",
       " ('婴童出行', 0.04),\n",
       " ('婴童寝居', 0.15),\n",
       " ('婴童时尚', 2.47),\n",
       " ('婴童服装', 0.7600000000000003),\n",
       " ('婴童洗护', 1.1800000000000004),\n",
       " ('婴童玩具', 0.19),\n",
       " ('婴童用品', 4.6000000000000005),\n",
       " ('婴童食品', 18.11),\n",
       " ('嫩白肌肤', 0.0),\n",
       " ('孕产经验', 5.87),\n",
       " ('孕期炫腹', 0.0),\n",
       " ('孕期穿搭', 0.13999999999999999),\n",
       " ('孕检', 0.0),\n",
       " ('学习', 0.02),\n",
       " ('学习必备书', 0.01),\n",
       " ('学习方法分享', 0.01),\n",
       " ('学前教育', 4.360000000000001),\n",
       " ('学生党', 0.060000000000000005),\n",
       " ('安卓手机', 0.0),\n",
       " ('安心裤', 0.01),\n",
       " ('宝宝写真', 1.1800000000000004),\n",
       " ('宝宝才艺', 0.9700000000000001),\n",
       " ('宝宝日常', 4.59),\n",
       " ('宝宝早教这么做', 0.0),\n",
       " ('宝宝辅食', 0.0),\n",
       " ('宝藏妈妈来报到', 0.0),\n",
       " ('宠物', 1.6900000000000006),\n",
       " ('宠物其他', 1.6600000000000008),\n",
       " ('宠物用品', 0.44),\n",
       " ('审美积累', 0.0),\n",
       " ('宫廷', 0.03),\n",
       " ('宫灯怎么样', 0.0),\n",
       " ('家具', 8.24),\n",
       " ('家居家装', 8.22),\n",
       " ('家居家装其他', 0.02),\n",
       " ('家居家装合集', 13.02),\n",
       " ('家居用品', 36.160000000000004),\n",
       " ('家居装饰', 11.38),\n",
       " ('家常菜', 0.0),\n",
       " ('家庭', 0.35000000000000003),\n",
       " ('家用电器', 9.629999999999999),\n",
       " ('宿舍专用小家电', 0.01),\n",
       " ('寒假去哪玩', 0.01),\n",
       " ('小s', 0.02),\n",
       " ('小公举', 0.0),\n",
       " ('小剧场', 5.15),\n",
       " ('小学教育', 3.4099999999999993),\n",
       " ('小方巾', 0.0),\n",
       " ('小朋友', 0.01),\n",
       " ('小粗腿', 0.0),\n",
       " ('小红书惊喜盒子', 0.03),\n",
       " ('小红书爆款美食', 0.0),\n",
       " ('小红书竞技场', 0.01),\n",
       " ('小说', 0.0),\n",
       " ('小说推荐', 0.0),\n",
       " ('小辫儿张云雷', 0.0),\n",
       " ('小黄瓜', 0.0),\n",
       " ('少女心游戏安利', 0.02),\n",
       " ('少女日记', 0.0),\n",
       " ('尖沙咀', 0.0),\n",
       " ('居家经验', 4.05),\n",
       " ('居酒屋', 0.01),\n",
       " ('屈臣氏怎么样', 0.01),\n",
       " ('展览演出', 2.1800000000000006),\n",
       " ('展览演出攻略', 0.0),\n",
       " ('山村野食', 0.09),\n",
       " ('崔玉涛', 0.01),\n",
       " ('工作使我快乐', 0.0),\n",
       " ('巧克力', 0.01),\n",
       " ('巧克巧蔻怎么样', 0.01),\n",
       " ('巴黎攻略', 0.0),\n",
       " ('布纸有爱怎么样', 0.01),\n",
       " ('帅哥', 0.15),\n",
       " ('平价好物', 0.0),\n",
       " ('平底锅', 0.0),\n",
       " ('平板', 0.01),\n",
       " ('幼儿园', 0.01),\n",
       " ('应用推荐', 10.360000000000003),\n",
       " ('底妆', 0.0),\n",
       " ('延展性', 0.0),\n",
       " ('开学', 0.0),\n",
       " ('张云雷杨九郎', 0.0),\n",
       " ('张艺兴', 0.0),\n",
       " ('彩妆', 141.21),\n",
       " ('彩妆实地海淘', 0.02),\n",
       " ('影视', 18.4),\n",
       " ('影视娱乐', 0.51),\n",
       " ('影视娱乐其他', 1.2600000000000005),\n",
       " ('影视推荐（视频）', 1.2900000000000005),\n",
       " ('影视混剪（视频）', 7.430000000000001),\n",
       " ('影视片段（视频）', 0.7700000000000001),\n",
       " ('影视资讯（视频）', 0.7700000000000001),\n",
       " ('影音智能', 0.33),\n",
       " ('待产', 0.01),\n",
       " ('待产包', 0.0),\n",
       " ('微信摇一摇', 0.01),\n",
       " ('微单', 0.0),\n",
       " ('快手菜', 0.0),\n",
       " ('怀孕', 0.03),\n",
       " ('怎样美白', 0.0),\n",
       " ('情侣装', 0.0),\n",
       " ('情感', 2.7000000000000006),\n",
       " ('情感其他', 0.17),\n",
       " ('情感心理', 0.09),\n",
       " ('情感日常', 0.38000000000000006),\n",
       " ('情感知识', 0.48),\n",
       " ('感恩所有的相遇', 0.0),\n",
       " ('戏剧', 0.0),\n",
       " ('成人教育', 4.250000000000001),\n",
       " ('成人用品', 0.03),\n",
       " ('我为瘦身打卡', 0.01),\n",
       " ('我家宝宝超搞笑', 0.0),\n",
       " ('我是女生', 0.01),\n",
       " ('我的偶像', 0.01),\n",
       " ('我的失眠读物', 0.01),\n",
       " ('我的平价好物', 0.01),\n",
       " ('我的护肤日常', 0.01),\n",
       " ('我的本命蔬菜', 0.07),\n",
       " ('我的美食日记', 0.01),\n",
       " ('我要当妈妈啦', 0.0),\n",
       " ('手工', 18.900000000000002),\n",
       " ('手机壁纸', 0.0),\n",
       " ('手机壳', 0.01),\n",
       " ('手游', 4.77),\n",
       " ('手绘图', 0.0),\n",
       " ('手表', 0.0),\n",
       " ('手账', 0.0),\n",
       " ('打底衫', 0.01),\n",
       " ('护发神器', 0.0),\n",
       " ('护发精油', 0.02),\n",
       " ('护发素', 0.09999999999999999),\n",
       " ('护理事业编', 0.0),\n",
       " ('护肝片', 0.0),\n",
       " ('护肤', 79.94000000000001),\n",
       " ('护肤品成分大起底', 0.0),\n",
       " ('拉伸', 0.0),\n",
       " ('拉伸不能停', 0.01),\n",
       " ('拌饭', 0.0),\n",
       " ('拍照', 0.01),\n",
       " ('拍照姿势不重样', 0.01),\n",
       " ('拔草COCO网红款', 0.01),\n",
       " ('拖延症', 0.0),\n",
       " ('拼夕夕衣服', 0.0),\n",
       " ('持妆力', 0.0),\n",
       " ('按摩', 0.0),\n",
       " ('按摩枕', 0.0),\n",
       " ('掉头发', 0.0),\n",
       " ('排气操', 0.0),\n",
       " ('探店', 0.0),\n",
       " ('接地气生活', 0.0),\n",
       " ('控油', 0.0),\n",
       " ('推拿', 0.0),\n",
       " ('提亮', 0.08),\n",
       " ('提亮乳', 0.0),\n",
       " ('提亮肤色', 0.0),\n",
       " ('提臀', 0.0),\n",
       " ('搞笑', 0.8400000000000001),\n",
       " ('搞笑其他', 1.7700000000000002),\n",
       " ('搞笑的日常', 0.0),\n",
       " ('摄影', 2.4200000000000004),\n",
       " ('摄影其他', 1.08),\n",
       " ('摄影器材', 4.46),\n",
       " ('摄影技巧', 67.44999999999999),\n",
       " ('摩托车', 0.2),\n",
       " ('收腹', 0.060000000000000005),\n",
       " ('改善肤质', 0.05),\n",
       " ('攻略', 27.069999999999997),\n",
       " ('教程', 0.04),\n",
       " ('教育', 11.830000000000002),\n",
       " ('教育其他', 12.830000000000004),\n",
       " ('教育日常', 0.9800000000000001),\n",
       " ('数码', 12.520000000000001),\n",
       " ('整容', 0.0),\n",
       " ('文具手账', 5.58),\n",
       " ('文化', 2.18),\n",
       " ('文化其他', 1.3800000000000003),\n",
       " ('文化娱乐', 1.11),\n",
       " ('文化娱乐其他', 2.8099999999999996),\n",
       " ('文字素材', 9.840000000000003),\n",
       " ('文学', 0.060000000000000005),\n",
       " ('文案', 0.0),\n",
       " ('斐济旅行', 0.0),\n",
       " ('新加坡攻略', 0.0),\n",
       " ('新年去哪玩', 0.01),\n",
       " ('方太怎么样', 0.0),\n",
       " ('施华洛世奇怎么样', 0.01),\n",
       " ('旅行', 0.0),\n",
       " ('旅行攻略', 0.0),\n",
       " ('无印良品怎么样', 0.01),\n",
       " ('无原创不设计', 0.0),\n",
       " ('日亚', 0.0),\n",
       " ('日常套路', 0.0),\n",
       " ('日常片段', 0.9600000000000004),\n",
       " ('日常片段其他', 19.320000000000004),\n",
       " ('日常穿搭', 0.01),\n",
       " ('日本', 0.0),\n",
       " ('日本母婴', 0.0),\n",
       " ('日系', 0.0),\n",
       " ('早教', 6.569999999999999),\n",
       " ('早餐', 0.01),\n",
       " ('早餐吃什么', 0.0),\n",
       " ('时尚', 12.050000000000002),\n",
       " ('时尚其他', 17.0),\n",
       " ('时装周', 0.0),\n",
       " ('明星', 4.26),\n",
       " ('明星娱乐资讯', 18.689999999999998),\n",
       " ('明星生活', 0.35000000000000003),\n",
       " ('明治怎么样', 0.01),\n",
       " ('易一怎么样', 0.0),\n",
       " ('易烊千玺', 0.0),\n",
       " ('星座', 0.9800000000000002),\n",
       " ('星座命理', 0.2900000000000001),\n",
       " ('星座命理其他', 0.7400000000000002),\n",
       " ('春夏美甲', 0.01),\n",
       " ('春熙路', 0.0),\n",
       " ('春节去哪玩', 0.0),\n",
       " ('显白', 0.0),\n",
       " ('晒娃', 1.6400000000000001),\n",
       " ('晒新包包', 0.0),\n",
       " ('晒蛙打卡', 0.0),\n",
       " ('普世安怎么样', 0.0),\n",
       " ('普信男', 0.0),\n",
       " ('景点', 14.279999999999998),\n",
       " ('景观设计', 0.07),\n",
       " ('智能', 0.02),\n",
       " ('暖宝宝', 0.0),\n",
       " ('暗恋', 0.0),\n",
       " ('月嫂', 0.02),\n",
       " ('月经不调', 0.0),\n",
       " ('期末考试周', 0.0),\n",
       " ('木吉乇怎么样', 0.01),\n",
       " ('朱一龙', 0.02),\n",
       " ('朱正廷', 0.0),\n",
       " ('朴灿烈', 0.0),\n",
       " ('机票', 0.0),\n",
       " ('杏仁', 0.01),\n",
       " ('杜塞尔多夫攻略', 0.0),\n",
       " ('杭州大剧院攻略', 0.0),\n",
       " ('杯子', 0.01),\n",
       " ('松下怎么样', 0.0),\n",
       " ('果汁', 0.0),\n",
       " ('柠檬的巧妙做法', 0.0),\n",
       " ('校园教育', 12.25),\n",
       " ('桌面数码', 0.12000000000000001),\n",
       " ('梳妆台', 0.060000000000000005),\n",
       " ('植树节去哪玩', 0.0),\n",
       " ('楼市资讯', 1.2300000000000004),\n",
       " ('橘红色', 0.01),\n",
       " ('歌曲', 0.0),\n",
       " ('正在看的综艺', 0.0),\n",
       " ('正能量', 0.0),\n",
       " ('正餐', 57.42000000000001),\n",
       " ('武术', 0.01),\n",
       " ('母婴', 7.350000000000001),\n",
       " ('母婴其他', 2.8200000000000003),\n",
       " ('母婴日常', 0.35000000000000003),\n",
       " ('每天涂防晒', 0.0),\n",
       " ('毕业季', 0.0),\n",
       " ('民宿', 2.5599999999999996),\n",
       " ('民宿酒店攻略', 0.01),\n",
       " ('民生新闻', 1.9600000000000006),\n",
       " ('民生资讯', 0.09000000000000001),\n",
       " ('民生资讯其他', 0.1),\n",
       " ('氨基酸洁面产品推荐', 0.01),\n",
       " ('水杯', 0.0),\n",
       " ('水瓶座', 0.01),\n",
       " ('水磨精华', 0.0),\n",
       " ('水谷雅子', 0.0),\n",
       " ('求职', 0.0),\n",
       " ('汤丽柏琦怎么样', 0.01),\n",
       " ('汤水', 0.0),\n",
       " ('汽车', 0.7300000000000002),\n",
       " ('汽车介绍', 1.8200000000000005),\n",
       " ('汽车其他', 0.9700000000000002),\n",
       " ('汽车文化', 0.01),\n",
       " ('汽车生活', 0.0),\n",
       " ('汽车知识', 0.04),\n",
       " ('汽车装饰', 0.35000000000000003),\n",
       " ('泰国旅行', 0.02),\n",
       " ('泰语', 0.01),\n",
       " ('洁面仪', 0.0),\n",
       " ('洗发水', 0.0),\n",
       " ('洗护用品', 0.0),\n",
       " ('洗衣神器', 0.0),\n",
       " ('测评', 0.0),\n",
       " ('海报', 0.0),\n",
       " ('海报设计', 0.01),\n",
       " ('海蓝之谜怎么样', 0.0),\n",
       " ('海藻', 0.0),\n",
       " ('消炎', 0.0),\n",
       " ('润唇膏', 0.0),\n",
       " ('淘宝', 0.0),\n",
       " ('淘宝店', 0.01),\n",
       " ('淡妆', 0.01),\n",
       " ('深圳攻略', 0.01),\n",
       " ('深蹲', 0.02),\n",
       " ('清新妆容', 0.01),\n",
       " ('清洁面部', 0.01),\n",
       " ('游戏', 3.2600000000000002),\n",
       " ('游戏其他', 0.37999999999999995),\n",
       " ('游戏玩家的日常', 0.0),\n",
       " ('游泳', 0.06),\n",
       " ('滋润型', 0.0),\n",
       " ('演唱翻唱', 0.11),\n",
       " ('演奏翻弹', 0.09),\n",
       " ('漫咖啡怎么样', 0.01),\n",
       " ('漫威电影推荐', 0.01),\n",
       " ('潮流', 0.16000000000000003),\n",
       " ('潮流信息', 0.0),\n",
       " ('潮流活动', 0.09),\n",
       " ('潮流艺术', 0.4),\n",
       " ('澳尔滨怎么样', 0.0),\n",
       " ('澳门巴黎人', 0.0),\n",
       " ('澳门美食', 0.02),\n",
       " ('火火兔怎么样', 0.0),\n",
       " ('火锅', 0.01),\n",
       " ('点心', 0.01),\n",
       " ('烘焙&甜品教程', 0.8200000000000003),\n",
       " ('热播电视剧', 0.0),\n",
       " ('焦虑', 0.01),\n",
       " ('煲汤', 0.0),\n",
       " ('熊出没', 0.05),\n",
       " ('爬行类动物', 0.01),\n",
       " ('爱笑的眼睛', 0.01),\n",
       " ('爵士', 0.0),\n",
       " ('爽肤水', 0.0),\n",
       " ('牙刷', 0.0),\n",
       " ('牙医', 0.0),\n",
       " ('牛奶', 0.0),\n",
       " ('牛排', 0.0),\n",
       " ('狗', 6.910000000000001),\n",
       " ('狗粮', 0.01),\n",
       " ('猪手', 0.0),\n",
       " ('猫', 8.410000000000002),\n",
       " ('玄学', 0.0),\n",
       " ('王一博', 0.0),\n",
       " ('王源', 0.0),\n",
       " ('王源新歌', 0.02),\n",
       " ('王者荣耀', 0.0),\n",
       " ('王菲', 0.01),\n",
       " ('玩具', 3.37),\n",
       " ('珊瑚粉', 0.0),\n",
       " ('理财', 0.01),\n",
       " ('瑜伽服', 0.0),\n",
       " ('甜品', 0.01),\n",
       " ('甜品烘焙秘方', 0.0),\n",
       " ('生巧克力', 0.0),\n",
       " ('生活小妙招', 0.0),\n",
       " ('生活科普', 5.770000000000001),\n",
       " ('生活美学', 0.0),\n",
       " ('生活记录', 10.500000000000002),\n",
       " ('生长发育', 0.0),\n",
       " ('电光蓝', 0.01),\n",
       " ('电动吸奶器', 0.0),\n",
       " ('电影', 3.0300000000000002),\n",
       " ('电影（图文）', 7.08),\n",
       " ('电视', 2.5999999999999996),\n",
       " ('电视剧', 0.01),\n",
       " ('电视（图文）', 4.7700000000000005),\n",
       " ('男士理容', 0.03),\n",
       " ('男朋友', 0.03),\n",
       " ('男鞋', 0.0),\n",
       " ('画眉', 0.01),\n",
       " ('画眉神器', 0.0),\n",
       " ('畅销书', 0.01),\n",
       " ('留学生', 0.0),\n",
       " ('痘痘', 0.0),\n",
       " ('瘦肚子', 0.0),\n",
       " ('瘦脸美容仪', 0.0),\n",
       " ('瘦腿', 0.01),\n",
       " ('瘦身', 0.0),\n",
       " ('瘦身日记', 0.01),\n",
       " ('白色情人节去哪玩', 0.0),\n",
       " ('皮肤嫩滑就靠它', 0.0),\n",
       " ('相册', 0.0),\n",
       " ('相声', 0.0),\n",
       " ('眼妆', 0.0),\n",
       " ('眼部', 0.0),\n",
       " ('知识', 0.2),\n",
       " ('知识科普', 11.970000000000002),\n",
       " ('短发控', 0.0),\n",
       " ('礼物', 0.0),\n",
       " ('社死', 0.0),\n",
       " ('社科', 0.59),\n",
       " ('社科人文', 5.6499999999999995),\n",
       " ('私藏播客推荐', 0.0),\n",
       " ('秋冬眼影', 0.0),\n",
       " ('秋天去哪玩', 0.02),\n",
       " ('秋季必备保湿乳液', 0.01),\n",
       " ('种草', 0.03),\n",
       " ('科学科普', 2.0700000000000003),\n",
       " ('科技数码', 0.7600000000000001),\n",
       " ('科技数码其他', 0.02),\n",
       " ('秦霄贤', 0.0),\n",
       " ('移动数码', 4.319999999999999),\n",
       " ('空间设计', 0.0),\n",
       " ('穿搭', 137.12),\n",
       " ('穿搭ootd', 0.27),\n",
       " ('穿着婚纱，嫁给爱情', 0.01),\n",
       " ('端游', 0.01),\n",
       " ('笔杆子养成', 0.0),\n",
       " ('笔记本', 0.05),\n",
       " ('签证', 0.01),\n",
       " ('简历这样做', 0.0),\n",
       " ('简笔画', 0.0),\n",
       " ('箱包', 23.91),\n",
       " ('篮球', 0.1),\n",
       " ('篮球赛事', 0.52),\n",
       " ('米酒', 0.02),\n",
       " ('粉扑', 0.0),\n",
       " ('粉红豹', 0.01),\n",
       " ('粉色少女心', 0.01),\n",
       " ('精华', 0.01),\n",
       " ('精品酒店', 0.01),\n",
       " ('精彩相声片段', 0.0),\n",
       " ('素材', 2.35),\n",
       " ('素材其他', 2.29),\n",
       " ('红包', 0.02),\n",
       " ('红玉髓', 0.0),\n",
       " ('红茶', 0.01),\n",
       " ('红豆粥', 0.01),\n",
       " ('红酒', 0.07),\n",
       " ('约会好去处', 0.01),\n",
       " ('约稿', 0.0),\n",
       " ('纪念日', 0.0),\n",
       " ('纯棉', 0.0),\n",
       " ('纸面膜', 0.01),\n",
       " ('纹身', 0.01),\n",
       " ('线下游戏', 0.20999999999999996),\n",
       " ('练出腹肌马甲线', 0.0),\n",
       " ('细软头发', 0.0),\n",
       " ('结婚', 0.01),\n",
       " ('结婚纪念日', 0.0),\n",
       " ('绘画', 23.169999999999995),\n",
       " ('绣球', 0.0),\n",
       " ('维多利亚港', 0.0),\n",
       " ('维多利亚的秘密怎么样', 0.0),\n",
       " ('维生素a', 0.0),\n",
       " ('综艺', 2.56),\n",
       " ('综艺混剪', 3.23),\n",
       " ('综艺片段', 2.5700000000000007),\n",
       " ('综艺（图文）', 0.8700000000000003),\n",
       " ('绿豆汤', 0.0),\n",
       " ('网上打印', 0.0),\n",
       " ('网名', 0.01),\n",
       " ('网红美食', 0.0),\n",
       " ('罗技怎么样', 0.01),\n",
       " ('羊肉', 0.0),\n",
       " ('美剧', 0.0),\n",
       " ('美图怎么样', 0.01),\n",
       " ('美图秀秀怎么样', 0.11999999999999998),\n",
       " ('美女', 0.060000000000000005),\n",
       " ('美女帅哥', 0.22000000000000008),\n",
       " ('美妆', 20.130000000000003),\n",
       " ('美妆其他', 4.21),\n",
       " ('美妆合集', 14.570000000000002),\n",
       " ('美宝莲怎么样', 0.01),\n",
       " ('美容仪器', 0.01),\n",
       " ('美容养生', 0.0),\n",
       " ('美心怎么样', 0.01),\n",
       " ('美术生', 0.01),\n",
       " ('美林怎么样', 0.04),\n",
       " ('美甲', 54.46999999999999),\n",
       " ('美白面膜', 0.01),\n",
       " ('美食', 25.8),\n",
       " ('美食VLOG', 2.4300000000000006),\n",
       " ('美食其他', 5.250000000000002),\n",
       " ('美食展示', 6.750000000000002),\n",
       " ('美食探店', 22.709999999999997),\n",
       " ('美食攻略', 0.0),\n",
       " ('美食教程', 74.72999999999999),\n",
       " ('美食测评', 13.910000000000002),\n",
       " ('翻包', 0.0),\n",
       " ('考研党', 0.0),\n",
       " ('耐高温', 0.0),\n",
       " ('职业培训', 9.23),\n",
       " ('职场', 1.0500000000000005),\n",
       " ('职场干货', 0.8400000000000003),\n",
       " ('职场行业', 8.32),\n",
       " ('联想怎么样', 0.0),\n",
       " ('聚会', 0.0),\n",
       " ('肌肉腿', 0.0),\n",
       " ('肖战', 0.02),\n",
       " ('肠粉', 0.0),\n",
       " ('肩带', 0.0),\n",
       " ('育儿知识', 0.0),\n",
       " ('育儿经', 0.0),\n",
       " ('育儿经验', 10.15),\n",
       " ('育学园怎么样', 0.0),\n",
       " ('胎儿', 0.0),\n",
       " ('胡同里怎么样', 0.02),\n",
       " ('能瘦脸的按摩手法', 0.02),\n",
       " ('脚部', 0.0),\n",
       " ('腰椎', 0.0),\n",
       " ('自制芋圆甜品', 0.02),\n",
       " ('自拍', 0.0),\n",
       " ('自然乐园怎么样', 0.0),\n",
       " ('自然色', 0.0),\n",
       " ('自然黑', 0.0),\n",
       " ('自驾游', 0.01),\n",
       " ('舞蹈', 12.069999999999999),\n",
       " ('良心淘宝店安利', 0.01),\n",
       " ('艺术', 4.119999999999999),\n",
       " ('花瓶', 0.0),\n",
       " ('苏打饼干', 0.0),\n",
       " ('英伦风', 0.01),\n",
       " ('英国绿', 0.0),\n",
       " ('英文歌', 0.01),\n",
       " ('英语学习', 0.01),\n",
       " ('苹果肌', 0.01),\n",
       " ('茶树精油', 0.0),\n",
       " ('茶餐厅', 0.0),\n",
       " ('草莓', 0.0),\n",
       " ('草莓晶', 0.0),\n",
       " ('草莓鼻', 0.0),\n",
       " ('荷兰攻略', 0.01),\n",
       " ('莫高窟', 0.01),\n",
       " ('菊花', 0.0),\n",
       " ('萌妃驾到影评', 0.01),\n",
       " ('萌娃', 0.52),\n",
       " ('萌娃其他', 0.01),\n",
       " ('萌萌哒', 0.0),\n",
       " ('营养均衡', 0.01),\n",
       " ('葡萄柚', 0.01),\n",
       " ('葡萄汁', 0.01),\n",
       " ('葡萄酒', 0.01),\n",
       " ('蔓越莓干', 0.0),\n",
       " ('薅羊毛', 0.0),\n",
       " ('虾仁', 0.01),\n",
       " ('蛋糕', 0.02),\n",
       " ('蜂蜜', 0.0),\n",
       " ('街头风', 0.01),\n",
       " ('补气血这么吃', 0.02),\n",
       " ('表情包', 0.79),\n",
       " ('衬衫', 0.0),\n",
       " ('装修', 41.1),\n",
       " ('裤子', 0.01),\n",
       " ('视频素材', 1.0900000000000003),\n",
       " ('角质产品', 0.0),\n",
       " ('计划', 0.0),\n",
       " ('设计', 0.01),\n",
       " ('设计师品牌', 0.05),\n",
       " ('设计感', 0.0),\n",
       " ('语录', 0.0),\n",
       " ('语法', 0.01),\n",
       " ('语言教育', 0.19999999999999998),\n",
       " ('说唱', 0.0),\n",
       " ('谢霆锋', 0.01),\n",
       " ('豆沙色', 0.01),\n",
       " ('豆浆', 0.0),\n",
       " ('贝亲怎么样', 0.01),\n",
       " ('质地', 0.0),\n",
       " ('购物地', 10.159999999999998),\n",
       " ('购物地攻略', 0.15000000000000002),\n",
       " ('贴纸', 0.0),\n",
       " ('资生堂怎么样', 0.0),\n",
       " ('资讯', 0.23),\n",
       " ('赖冠霖', 0.0),\n",
       " ('超保湿化妆水', 0.0),\n",
       " ('超市', 0.02),\n",
       " ('足球', 0.09),\n",
       " ('足球赛事', 0.08),\n",
       " ('跑步', 0.0),\n",
       " ('跑步鞋', 0.0),\n",
       " ('跟着视频画眼影', 0.0),\n",
       " ('跨年', 0.02),\n",
       " ('路易威登怎么样', 0.0),\n",
       " ('跳舞', 0.0),\n",
       " ('身体柔韧如何提高', 0.0),\n",
       " ('软件服务', 8.23),\n",
       " ('软膏', 0.0),\n",
       " ('运动', 2.81),\n",
       " ('运动健身', 4.760000000000001),\n",
       " ('运动健身其他', 0.9900000000000002),\n",
       " ('运动鞋的N种搭法', 0.01),\n",
       " ('运城学院攻略', 0.0),\n",
       " ('近视', 0.0),\n",
       " ('这支香水最性感', 0.0),\n",
       " ('追剧打卡', 0.03),\n",
       " ('送男朋友', 0.0),\n",
       " ('送男票', 0.0),\n",
       " ('送礼', 0.0),\n",
       " ('送给男票的礼物', 0.0),\n",
       " ('适合女生玩的游戏', 0.0),\n",
       " ('适合孩子看的纪录片', 0.0),\n",
       " ('适合年轻人的眼霜', 0.01),\n",
       " ('透明蜜粉', 0.01),\n",
       " ('通便', 0.05),\n",
       " ('道路交通', 1.3400000000000005),\n",
       " ('遗憾', 0.0),\n",
       " ('配色分享', 0.01),\n",
       " ('配饰', 31.53),\n",
       " ('酒', 1.2000000000000004),\n",
       " ('酒具', 0.0),\n",
       " ('酒庄', 0.0),\n",
       " ('酒店', 2.6100000000000003),\n",
       " ('酒店民宿', 7.29),\n",
       " ('酒杯', 0.02),\n",
       " ('酸奶', 0.01),\n",
       " ('野生动物', 0.12000000000000001),\n",
       " ('金属元素', 0.0),\n",
       " ('金融理财', 2.48),\n",
       " ('钱包', 0.0),\n",
       " ('钻石', 0.0),\n",
       " ('铁元', 0.0),\n",
       " ('长沙旅游攻略', 0.0),\n",
       " ('长痘痘', 0.0),\n",
       " ('门德尔松怎么样', 0.0),\n",
       " ('闲鱼', 0.0),\n",
       " ('阅读', 17.490000000000002),\n",
       " ('防弹少年团', 0.01),\n",
       " ('阳台', 0.01),\n",
       " ('阴影', 0.0),\n",
       " ('阿胶', 0.0),\n",
       " ('阿达帕林', 0.0),\n",
       " ('随笔', 0.0),\n",
       " ('雪莉', 0.0),\n",
       " ('零基础健身房入门', 0.05),\n",
       " ('零食', 10.780000000000003),\n",
       " ('零食测评', 0.15),\n",
       " ('露台', 0.0),\n",
       " ('露娜怎么样', 0.0),\n",
       " ('青春芒果节', 0.0),\n",
       " ('青茶怎么样', 0.0),\n",
       " ('非酒精类饮料', 7.950000000000001),\n",
       " ('面包甜点', 29.22),\n",
       " ('面膜大集合', 0.01),\n",
       " ('面试有秘招', 0.0),\n",
       " ('面霜', 0.0),\n",
       " ('面馆', 0.0),\n",
       " ('鞋子', 0.0),\n",
       " ('鞋履', 0.52),\n",
       " ('鞋靴', 18.599999999999998),\n",
       " ('韩国', 0.03),\n",
       " ('韩国攻略', 0.0),\n",
       " ('音乐', 23.849999999999998),\n",
       " ('音乐其他', 0.0),\n",
       " ('音乐分享', 0.27),\n",
       " ('音乐现场', 0.13),\n",
       " ('页游', 0.0),\n",
       " ('项链', 0.0),\n",
       " ('领养', 0.0),\n",
       " ('颗粒感', 0.0),\n",
       " ('飞机上看风景', 0.0),\n",
       " ('飞机抱', 0.02),\n",
       " ('食谱', 11.610000000000001),\n",
       " ('餐厅', 33.32),\n",
       " ('饭圈美工', 0.0),\n",
       " ('饮品教程', 0.15999999999999998),\n",
       " ('饮品测评', 0.0),\n",
       " ('饼干', 0.01),\n",
       " ('首饰', 0.0),\n",
       " ('香水', 6.989999999999999),\n",
       " ('香港', 0.0),\n",
       " ('香港值得买的护肤品', 0.04),\n",
       " ('香港酒店', 0.0),\n",
       " ('马甲', 0.01),\n",
       " ('马甲线', 0.0),\n",
       " ('骨盆', 0.0),\n",
       " ('高以翔', 0.0),\n",
       " ('高保湿', 0.01),\n",
       " ('高冷', 0.0),\n",
       " ('高效瘦腿攻略', 0.0),\n",
       " ('高机能水', 0.0),\n",
       " ('高级感配色', 0.01),\n",
       " ('高考', 0.01),\n",
       " ('高跟鞋', 0.02),\n",
       " ('魅可怎么样', 0.01),\n",
       " ('鲁迅', 0.0),\n",
       " ('麦当劳怎么样', 0.01),\n",
       " ('麦片', 0.03),\n",
       " ('麻辣香锅', 0.01),\n",
       " ('黄夏温', 0.01),\n",
       " ('黑吕', 0.0),\n",
       " ('黑客', 0.0)]"
      ]
     },
     "execution_count": 17,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#将'标签'和'占比'两列的每一行转为元组tuple，然后将所有数据以列表list形式输出\n",
    "focus_list=df_fans[['标签', '占比']].apply(lambda x: tuple(x), axis=1).values.tolist()\n",
    "focus_list"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### 数据可视化"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts':'http://localhost:8888/nbextensions/assets/echarts.min', 'china':'http://localhost:8888/nbextensions/assets/maps/china'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "\n",
       "        <div id=\"edf12915cb6246379ceeb21765d745c0\" style=\"width:900px; height:500px;\"></div>\n",
       "\n",
       "<script>\n",
       "        require(['echarts', 'china'], function(echarts) {\n",
       "                var chart_edf12915cb6246379ceeb21765d745c0 = echarts.init(\n",
       "                    document.getElementById('edf12915cb6246379ceeb21765d745c0'), 'white', {renderer: 'canvas'});\n",
       "                var option_edf12915cb6246379ceeb21765d745c0 = {\n",
       "    \"animation\": true,\n",
       "    \"animationThreshold\": 2000,\n",
       "    \"animationDuration\": 1000,\n",
       "    \"animationEasing\": \"cubicOut\",\n",
       "    \"animationDelay\": 0,\n",
       "    \"animationDurationUpdate\": 300,\n",
       "    \"animationEasingUpdate\": \"cubicOut\",\n",
       "    \"animationDelayUpdate\": 0,\n",
       "    \"color\": [\n",
       "        \"#c23531\",\n",
       "        \"#2f4554\",\n",
       "        \"#61a0a8\",\n",
       "        \"#d48265\",\n",
       "        \"#749f83\",\n",
       "        \"#ca8622\",\n",
       "        \"#bda29a\",\n",
       "        \"#6e7074\",\n",
       "        \"#546570\",\n",
       "        \"#c4ccd3\",\n",
       "        \"#f05b72\",\n",
       "        \"#ef5b9c\",\n",
       "        \"#f47920\",\n",
       "        \"#905a3d\",\n",
       "        \"#fab27b\",\n",
       "        \"#2a5caa\",\n",
       "        \"#444693\",\n",
       "        \"#726930\",\n",
       "        \"#b2d235\",\n",
       "        \"#6d8346\",\n",
       "        \"#ac6767\",\n",
       "        \"#1d953f\",\n",
       "        \"#6950a1\",\n",
       "        \"#918597\"\n",
       "    ],\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"map\",\n",
       "            \"name\": \"\\u7701\\u4efd/\\u5360\\u6bd4\",\n",
       "            \"label\": {\n",
       "                \"show\": true,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8\n",
       "            },\n",
       "            \"mapType\": \"china\",\n",
       "            \"data\": [\n",
       "                {\n",
       "                    \"name\": \"\\u4e0a\\u6d77\",\n",
       "                    \"value\": 9.495454545454544\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u4e91\\u5357\",\n",
       "                    \"value\": 1.9681818181818185\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5185\\u8499\\u53e4\",\n",
       "                    \"value\": 0.35750000000000004\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5317\\u4eac\",\n",
       "                    \"value\": 10.532727272727273\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u53f0\\u6e7e\",\n",
       "                    \"value\": 0.2564705882352941\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5409\\u6797\",\n",
       "                    \"value\": 1.0565\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u56db\\u5ddd\",\n",
       "                    \"value\": 6.239090909090908\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5929\\u6d25\",\n",
       "                    \"value\": 1.7554545454545454\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5b81\\u590f\",\n",
       "                    \"value\": 0.25875\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5b89\\u5fbd\",\n",
       "                    \"value\": 2.368636363636363\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5c71\\u4e1c\",\n",
       "                    \"value\": 4.549999999999999\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5c71\\u897f\",\n",
       "                    \"value\": 0.8342857142857143\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5e7f\\u4e1c\",\n",
       "                    \"value\": 16.327727272727273\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5e7f\\u897f\",\n",
       "                    \"value\": 1.4780952380952384\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u65b0\\u7586\",\n",
       "                    \"value\": 0.38444444444444437\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u6c5f\\u82cf\",\n",
       "                    \"value\": 6.367727272727273\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u6c5f\\u897f\",\n",
       "                    \"value\": 1.5709090909090906\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u6cb3\\u5317\",\n",
       "                    \"value\": 2.132272727272727\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u6cb3\\u5357\",\n",
       "                    \"value\": 2.898181818181818\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u6d59\\u6c5f\",\n",
       "                    \"value\": 7.887272727272728\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u6d77\\u5357\",\n",
       "                    \"value\": 0.4664999999999999\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u6e56\\u5317\",\n",
       "                    \"value\": 3.155454545454545\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u6e56\\u5357\",\n",
       "                    \"value\": 3.1172727272727268\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u6fb3\\u95e8\",\n",
       "                    \"value\": 0.20625\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u7518\\u8083\",\n",
       "                    \"value\": 0.4228571428571428\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u798f\\u5efa\",\n",
       "                    \"value\": 4.225454545454545\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u8499\\u53e4\",\n",
       "                    \"value\": 0.085\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u897f\\u85cf\",\n",
       "                    \"value\": 0.15785714285714286\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u8d35\\u5dde\",\n",
       "                    \"value\": 0.6060000000000001\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u8fbd\\u5b81\",\n",
       "                    \"value\": 2.6672727272727275\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u91cd\\u5e86\",\n",
       "                    \"value\": 2.6504545454545454\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u9655\\u897f\",\n",
       "                    \"value\": 2.2568181818181814\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u9752\\u6d77\",\n",
       "                    \"value\": 0.10777777777777778\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u9999\\u6e2f\",\n",
       "                    \"value\": 0.635\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u9ed1\\u9f99\\u6c5f\",\n",
       "                    \"value\": 1.4149999999999998\n",
       "                }\n",
       "            ],\n",
       "            \"roam\": true,\n",
       "            \"aspectScale\": 0.75,\n",
       "            \"nameProperty\": \"name\",\n",
       "            \"selectedMode\": false,\n",
       "            \"zoom\": 1,\n",
       "            \"mapValueCalculation\": \"sum\",\n",
       "            \"showLegendSymbol\": true,\n",
       "            \"emphasis\": {}\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"\\u7701\\u4efd/\\u5360\\u6bd4\"\n",
       "            ],\n",
       "            \"selected\": {\n",
       "                \"\\u7701\\u4efd/\\u5360\\u6bd4\": true\n",
       "            },\n",
       "            \"show\": true,\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10,\n",
       "            \"itemWidth\": 25,\n",
       "            \"itemHeight\": 14\n",
       "        }\n",
       "    ],\n",
       "    \"tooltip\": {\n",
       "        \"show\": true,\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"showContent\": true,\n",
       "        \"alwaysShowContent\": false,\n",
       "        \"showDelay\": 0,\n",
       "        \"hideDelay\": 100,\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"borderWidth\": 0,\n",
       "        \"padding\": 5\n",
       "    },\n",
       "    \"title\": [\n",
       "        {\n",
       "            \"text\": \"\\u7c89\\u4e1d\\u5730\\u57df\\u5206\\u5e03\",\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10\n",
       "        }\n",
       "    ],\n",
       "    \"toolbox\": {\n",
       "        \"show\": true,\n",
       "        \"orient\": \"horizontal\",\n",
       "        \"itemSize\": 15,\n",
       "        \"itemGap\": 10,\n",
       "        \"left\": \"90%\",\n",
       "        \"feature\": {\n",
       "            \"saveAsImage\": {\n",
       "                \"type\": \"png\",\n",
       "                \"backgroundColor\": \"auto\",\n",
       "                \"connectedBackgroundColor\": \"#fff\",\n",
       "                \"show\": true,\n",
       "                \"title\": \"\\u4fdd\\u5b58\\u4e3a\\u56fe\\u7247\",\n",
       "                \"pixelRatio\": 1\n",
       "            },\n",
       "            \"restore\": {\n",
       "                \"show\": true,\n",
       "                \"title\": \"\\u8fd8\\u539f\"\n",
       "            },\n",
       "            \"dataView\": {\n",
       "                \"show\": true,\n",
       "                \"title\": \"\\u6570\\u636e\\u89c6\\u56fe\",\n",
       "                \"readOnly\": false,\n",
       "                \"lang\": [\n",
       "                    \"\\u6570\\u636e\\u89c6\\u56fe\",\n",
       "                    \"\\u5173\\u95ed\",\n",
       "                    \"\\u5237\\u65b0\"\n",
       "                ],\n",
       "                \"backgroundColor\": \"#fff\",\n",
       "                \"textareaColor\": \"#fff\",\n",
       "                \"textareaBorderColor\": \"#333\",\n",
       "                \"textColor\": \"#000\",\n",
       "                \"buttonColor\": \"#c23531\",\n",
       "                \"buttonTextColor\": \"#fff\"\n",
       "            },\n",
       "            \"dataZoom\": {\n",
       "                \"show\": true,\n",
       "                \"title\": {\n",
       "                    \"zoom\": \"\\u533a\\u57df\\u7f29\\u653e\",\n",
       "                    \"back\": \"\\u533a\\u57df\\u7f29\\u653e\\u8fd8\\u539f\"\n",
       "                },\n",
       "                \"icon\": {},\n",
       "                \"xAxisIndex\": false,\n",
       "                \"yAxisIndex\": false,\n",
       "                \"filterMode\": \"filter\"\n",
       "            },\n",
       "            \"magicType\": {\n",
       "                \"show\": true,\n",
       "                \"type\": [\n",
       "                    \"line\",\n",
       "                    \"bar\",\n",
       "                    \"stack\",\n",
       "                    \"tiled\"\n",
       "                ],\n",
       "                \"title\": {\n",
       "                    \"line\": \"\\u5207\\u6362\\u4e3a\\u6298\\u7ebf\\u56fe\",\n",
       "                    \"bar\": \"\\u5207\\u6362\\u4e3a\\u67f1\\u72b6\\u56fe\",\n",
       "                    \"stack\": \"\\u5207\\u6362\\u4e3a\\u5806\\u53e0\",\n",
       "                    \"tiled\": \"\\u5207\\u6362\\u4e3a\\u5e73\\u94fa\"\n",
       "                },\n",
       "                \"icon\": {}\n",
       "            },\n",
       "            \"brush\": {\n",
       "                \"icon\": {},\n",
       "                \"title\": {\n",
       "                    \"rect\": \"\\u77e9\\u5f62\\u9009\\u62e9\",\n",
       "                    \"polygon\": \"\\u5708\\u9009\",\n",
       "                    \"lineX\": \"\\u6a2a\\u5411\\u9009\\u62e9\",\n",
       "                    \"lineY\": \"\\u7eb5\\u5411\\u9009\\u62e9\",\n",
       "                    \"keep\": \"\\u4fdd\\u6301\\u9009\\u62e9\",\n",
       "                    \"clear\": \"\\u6e05\\u9664\\u9009\\u62e9\"\n",
       "                }\n",
       "            }\n",
       "        }\n",
       "    },\n",
       "    \"visualMap\": {\n",
       "        \"show\": true,\n",
       "        \"type\": \"continuous\",\n",
       "        \"min\": 0,\n",
       "        \"max\": 10,\n",
       "        \"inRange\": {\n",
       "            \"color\": [\n",
       "                \"#50a3ba\",\n",
       "                \"#eac763\",\n",
       "                \"#d94e5d\"\n",
       "            ]\n",
       "        },\n",
       "        \"calculable\": true,\n",
       "        \"inverse\": false,\n",
       "        \"splitNumber\": 5,\n",
       "        \"orient\": \"vertical\",\n",
       "        \"showLabel\": true,\n",
       "        \"itemWidth\": 20,\n",
       "        \"itemHeight\": 140,\n",
       "        \"borderWidth\": 0\n",
       "    }\n",
       "};\n",
       "                chart_edf12915cb6246379ceeb21765d745c0.setOption(option_edf12915cb6246379ceeb21765d745c0);\n",
       "        });\n",
       "    </script>\n"
      ],
      "text/plain": [
       "<pyecharts.render.display.HTML at 0x1e5d006fd90>"
      ]
     },
     "execution_count": 18,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from pyecharts import options as opts\n",
    "from pyecharts.charts import WordCloud\n",
    "from pyecharts.globals import SymbolType\n",
    "\n",
    "fan_focus = (\n",
    "    WordCloud()\n",
    "        .add(series_name=\"粉丝关注焦点\",\n",
    "                data_pair=focus_list,\n",
    "                word_size_range=[20, 80],  #字体大小范围\n",
    "                rotate_step=90,            #文字旋转90°\n",
    "                textstyle_opts=opts.TextStyleOpts(font_family=\"cursive\"),\n",
    "        )\n",
    "        .set_global_opts(\n",
    "        title_opts=opts.TitleOpts(\n",
    "            title=\"粉丝关注焦点\",\n",
    "            title_textstyle_opts=opts.TextStyleOpts(font_size=20),\n",
    "            pos_left='center',\n",
    "            pos_top = '5%'                 #调整标题位置\n",
    "        ),\n",
    "        tooltip_opts=opts.TooltipOpts(is_show=True),\n",
    "    )\n",
    ")\n",
    "c.render_notebook()\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "穿搭，彩妆，护肤，发型，减肥等是粉丝高频关注的焦点"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 粉丝人群标签"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### 数据处理"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>行业id</th>\n",
       "      <th>行业名称</th>\n",
       "      <th>人群标签</th>\n",
       "      <th>占比</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1698</td>\n",
       "      <td>连衣裙</td>\n",
       "      <td>流行男女</td>\n",
       "      <td>100.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1698</td>\n",
       "      <td>连衣裙</td>\n",
       "      <td>爱买彩妆党</td>\n",
       "      <td>56.21</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>1698</td>\n",
       "      <td>连衣裙</td>\n",
       "      <td>学生党</td>\n",
       "      <td>34.65</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>1698</td>\n",
       "      <td>连衣裙</td>\n",
       "      <td>瘦身男女</td>\n",
       "      <td>30.72</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>1698</td>\n",
       "      <td>连衣裙</td>\n",
       "      <td>品质吃货</td>\n",
       "      <td>30.63</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>105</th>\n",
       "      <td>3205</td>\n",
       "      <td>皮衣</td>\n",
       "      <td>流行男女</td>\n",
       "      <td>99.53</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>106</th>\n",
       "      <td>3205</td>\n",
       "      <td>皮衣</td>\n",
       "      <td>学生党</td>\n",
       "      <td>31.05</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>107</th>\n",
       "      <td>3205</td>\n",
       "      <td>皮衣</td>\n",
       "      <td>爱买彩妆党</td>\n",
       "      <td>31.05</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>108</th>\n",
       "      <td>3205</td>\n",
       "      <td>皮衣</td>\n",
       "      <td>品质吃货</td>\n",
       "      <td>31.05</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>109</th>\n",
       "      <td>3205</td>\n",
       "      <td>皮衣</td>\n",
       "      <td>瘦身男女</td>\n",
       "      <td>30.60</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>110 rows × 4 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "     行业id 行业名称   人群标签      占比\n",
       "0    1698  连衣裙   流行男女  100.00\n",
       "1    1698  连衣裙  爱买彩妆党   56.21\n",
       "2    1698  连衣裙    学生党   34.65\n",
       "3    1698  连衣裙   瘦身男女   30.72\n",
       "4    1698  连衣裙   品质吃货   30.63\n",
       "..    ...  ...    ...     ...\n",
       "105  3205   皮衣   流行男女   99.53\n",
       "106  3205   皮衣    学生党   31.05\n",
       "107  3205   皮衣  爱买彩妆党   31.05\n",
       "108  3205   皮衣   品质吃货   31.05\n",
       "109  3205   皮衣   瘦身男女   30.60\n",
       "\n",
       "[110 rows x 4 columns]"
      ]
     },
     "execution_count": 19,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 导入数据文件\n",
    "df5=pd.read_excel('服饰行业粉丝人群标签.xlsx')\n",
    "df5"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>人群标签</th>\n",
       "      <th>占比</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>专注护肤党</td>\n",
       "      <td>159.31</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>品质吃货</td>\n",
       "      <td>525.50</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>学生党</td>\n",
       "      <td>492.09</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>平价吃货</td>\n",
       "      <td>377.97</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>流行男女</td>\n",
       "      <td>2189.54</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>爱买彩妆党</td>\n",
       "      <td>992.40</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>爱家控</td>\n",
       "      <td>332.92</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>瘦身男女</td>\n",
       "      <td>409.10</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "    人群标签       占比\n",
       "0  专注护肤党   159.31\n",
       "1   品质吃货   525.50\n",
       "2    学生党   492.09\n",
       "3   平价吃货   377.97\n",
       "4   流行男女  2189.54\n",
       "5  爱买彩妆党   992.40\n",
       "6    爱家控   332.92\n",
       "7   瘦身男女   409.10"
      ]
     },
     "execution_count": 20,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_biaoqian = df5.groupby(['人群标签']).agg({'占比': 'sum'}).reset_index()\n",
    "df_biaoqian"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>人群标签</th>\n",
       "      <th>占比</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>专注护肤党</td>\n",
       "      <td>159.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>品质吃货</td>\n",
       "      <td>526.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>学生党</td>\n",
       "      <td>492.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>平价吃货</td>\n",
       "      <td>378.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>流行男女</td>\n",
       "      <td>2190.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>爱买彩妆党</td>\n",
       "      <td>992.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>爱家控</td>\n",
       "      <td>333.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>瘦身男女</td>\n",
       "      <td>409.0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "    人群标签      占比\n",
       "0  专注护肤党   159.0\n",
       "1   品质吃货   526.0\n",
       "2    学生党   492.0\n",
       "3   平价吃货   378.0\n",
       "4   流行男女  2190.0\n",
       "5  爱买彩妆党   992.0\n",
       "6    爱家控   333.0\n",
       "7   瘦身男女   409.0"
      ]
     },
     "execution_count": 21,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#round()四舍五入保留四位小数\n",
    "df_biaoqian['占比']=round(df_biaoqian['占比'],0)  \n",
    "df_biaoqian"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[('专注护肤党', 159.0),\n",
       " ('品质吃货', 526.0),\n",
       " ('学生党', 492.0),\n",
       " ('平价吃货', 378.0),\n",
       " ('流行男女', 2190.0),\n",
       " ('爱买彩妆党', 992.0),\n",
       " ('爱家控', 333.0),\n",
       " ('瘦身男女', 409.0)]"
      ]
     },
     "execution_count": 22,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#转化为列表\n",
    "renqun_list=df_biaoqian[['人群标签', '占比']].apply(lambda x: tuple(x), axis=1).values.tolist()\n",
    "renqun_list"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### 数据可视化"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 47,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts':'http://localhost:8888/nbextensions/assets/echarts.min'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "\n",
       "        <div id=\"7de8417f484b4083960d0ed775352f94\" style=\"width:900px; height:500px;\"></div>\n",
       "\n",
       "<script>\n",
       "        require(['echarts'], function(echarts) {\n",
       "                var chart_7de8417f484b4083960d0ed775352f94 = echarts.init(\n",
       "                    document.getElementById('7de8417f484b4083960d0ed775352f94'), 'white', {renderer: 'canvas'});\n",
       "                var option_7de8417f484b4083960d0ed775352f94 = {\n",
       "    \"animation\": true,\n",
       "    \"animationThreshold\": 2000,\n",
       "    \"animationDuration\": 1000,\n",
       "    \"animationEasing\": \"cubicOut\",\n",
       "    \"animationDelay\": 0,\n",
       "    \"animationDurationUpdate\": 300,\n",
       "    \"animationEasingUpdate\": \"cubicOut\",\n",
       "    \"animationDelayUpdate\": 0,\n",
       "    \"color\": [\n",
       "        \"#c23531\",\n",
       "        \"#2f4554\",\n",
       "        \"#61a0a8\",\n",
       "        \"#d48265\",\n",
       "        \"#749f83\",\n",
       "        \"#ca8622\",\n",
       "        \"#bda29a\",\n",
       "        \"#6e7074\",\n",
       "        \"#546570\",\n",
       "        \"#c4ccd3\",\n",
       "        \"#f05b72\",\n",
       "        \"#ef5b9c\",\n",
       "        \"#f47920\",\n",
       "        \"#905a3d\",\n",
       "        \"#fab27b\",\n",
       "        \"#2a5caa\",\n",
       "        \"#444693\",\n",
       "        \"#726930\",\n",
       "        \"#b2d235\",\n",
       "        \"#6d8346\",\n",
       "        \"#ac6767\",\n",
       "        \"#1d953f\",\n",
       "        \"#6950a1\",\n",
       "        \"#918597\"\n",
       "    ],\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"pie\",\n",
       "            \"clockwise\": true,\n",
       "            \"data\": [\n",
       "                {\n",
       "                    \"name\": \"\\u4e13\\u6ce8\\u62a4\\u80a4\\u515a\",\n",
       "                    \"value\": 159.0\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u54c1\\u8d28\\u5403\\u8d27\",\n",
       "                    \"value\": 526.0\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5b66\\u751f\\u515a\",\n",
       "                    \"value\": 492.0\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5e73\\u4ef7\\u5403\\u8d27\",\n",
       "                    \"value\": 378.0\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u6d41\\u884c\\u7537\\u5973\",\n",
       "                    \"value\": 2190.0\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u7231\\u4e70\\u5f69\\u5986\\u515a\",\n",
       "                    \"value\": 992.0\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u7231\\u5bb6\\u63a7\",\n",
       "                    \"value\": 333.0\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u7626\\u8eab\\u7537\\u5973\",\n",
       "                    \"value\": 409.0\n",
       "                }\n",
       "            ],\n",
       "            \"radius\": [\n",
       "                \"0%\",\n",
       "                \"75%\"\n",
       "            ],\n",
       "            \"center\": [\n",
       "                \"50%\",\n",
       "                \"50%\"\n",
       "            ],\n",
       "            \"label\": {\n",
       "                \"show\": true,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8,\n",
       "                \"formatter\": \"{b}: {c}\"\n",
       "            },\n",
       "            \"rippleEffect\": {\n",
       "                \"show\": true,\n",
       "                \"brushType\": \"stroke\",\n",
       "                \"scale\": 2.5,\n",
       "                \"period\": 4\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"\\u4e13\\u6ce8\\u62a4\\u80a4\\u515a\",\n",
       "                \"\\u54c1\\u8d28\\u5403\\u8d27\",\n",
       "                \"\\u5b66\\u751f\\u515a\",\n",
       "                \"\\u5e73\\u4ef7\\u5403\\u8d27\",\n",
       "                \"\\u6d41\\u884c\\u7537\\u5973\",\n",
       "                \"\\u7231\\u4e70\\u5f69\\u5986\\u515a\",\n",
       "                \"\\u7231\\u5bb6\\u63a7\",\n",
       "                \"\\u7626\\u8eab\\u7537\\u5973\"\n",
       "            ],\n",
       "            \"selected\": {},\n",
       "            \"show\": true,\n",
       "            \"left\": \"15%\",\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10,\n",
       "            \"itemWidth\": 25,\n",
       "            \"itemHeight\": 14\n",
       "        }\n",
       "    ],\n",
       "    \"tooltip\": {\n",
       "        \"show\": true,\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"showContent\": true,\n",
       "        \"alwaysShowContent\": false,\n",
       "        \"showDelay\": 0,\n",
       "        \"hideDelay\": 100,\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"borderWidth\": 0,\n",
       "        \"padding\": 5\n",
       "    },\n",
       "    \"title\": [\n",
       "        {\n",
       "            \"text\": \"\\u7c89\\u4e1d\\u4eba\\u7fa4\\u6807\\u7b7e\",\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10\n",
       "        }\n",
       "    ]\n",
       "};\n",
       "                chart_7de8417f484b4083960d0ed775352f94.setOption(option_7de8417f484b4083960d0ed775352f94);\n",
       "        });\n",
       "    </script>\n"
      ],
      "text/plain": [
       "<pyecharts.render.display.HTML at 0x1e5d0634610>"
      ]
     },
     "execution_count": 47,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#饼图：https://gallery.pyecharts.org/#/Pie/pie_base\n",
    "from pyecharts import options as opts\n",
    "from pyecharts.charts import Pie\n",
    "from pyecharts.faker import Faker\n",
    "\n",
    "c = (\n",
    "    Pie()\n",
    "    .add(\"\", renqun_list)\n",
    "    .set_global_opts(\n",
    "        title_opts=opts.TitleOpts(title=\"粉丝人群标签\"),\n",
    "        legend_opts=opts.LegendOpts(pos_left=\"15%\"),      #调整位置\n",
    "    )\n",
    "    .set_series_opts(label_opts=opts.LabelOpts(formatter=\"{b}: {c}\"))\n",
    ")\n",
    "c.render_notebook()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 服饰行业"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>行业id</th>\n",
       "      <th>行业名称</th>\n",
       "      <th>年龄段</th>\n",
       "      <th>占比</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1698</td>\n",
       "      <td>连衣裙</td>\n",
       "      <td>&lt;18</td>\n",
       "      <td>0.1289</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1698</td>\n",
       "      <td>连衣裙</td>\n",
       "      <td>18-24</td>\n",
       "      <td>0.4813</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>1698</td>\n",
       "      <td>连衣裙</td>\n",
       "      <td>25-34</td>\n",
       "      <td>0.3426</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>1698</td>\n",
       "      <td>连衣裙</td>\n",
       "      <td>35-44</td>\n",
       "      <td>0.0235</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>1698</td>\n",
       "      <td>连衣裙</td>\n",
       "      <td>&gt;44</td>\n",
       "      <td>0.0051</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>105</th>\n",
       "      <td>3205</td>\n",
       "      <td>皮衣</td>\n",
       "      <td>&lt;18</td>\n",
       "      <td>0.1091</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>106</th>\n",
       "      <td>3205</td>\n",
       "      <td>皮衣</td>\n",
       "      <td>18-24</td>\n",
       "      <td>0.4651</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>107</th>\n",
       "      <td>3205</td>\n",
       "      <td>皮衣</td>\n",
       "      <td>25-34</td>\n",
       "      <td>0.3757</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>108</th>\n",
       "      <td>3205</td>\n",
       "      <td>皮衣</td>\n",
       "      <td>35-44</td>\n",
       "      <td>0.0249</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>109</th>\n",
       "      <td>3205</td>\n",
       "      <td>皮衣</td>\n",
       "      <td>&gt;44</td>\n",
       "      <td>0.0049</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>110 rows × 4 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "     行业id 行业名称    年龄段      占比\n",
       "0    1698  连衣裙    <18  0.1289\n",
       "1    1698  连衣裙  18-24  0.4813\n",
       "2    1698  连衣裙  25-34  0.3426\n",
       "3    1698  连衣裙  35-44  0.0235\n",
       "4    1698  连衣裙    >44  0.0051\n",
       "..    ...  ...    ...     ...\n",
       "105  3205   皮衣    <18  0.1091\n",
       "106  3205   皮衣  18-24  0.4651\n",
       "107  3205   皮衣  25-34  0.3757\n",
       "108  3205   皮衣  35-44  0.0249\n",
       "109  3205   皮衣    >44  0.0049\n",
       "\n",
       "[110 rows x 4 columns]"
      ]
     },
     "execution_count": 24,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 导入数据文件\n",
    "df2=pd.read_excel('服饰行业年龄分布.xlsx')\n",
    "df2"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['连衣裙',\n",
       " '夹克',\n",
       " '蕾丝雪纺衫',\n",
       " '背心吊带',\n",
       " '西装西裤',\n",
       " '羽绒服',\n",
       " '牛仔裤',\n",
       " '休闲裤',\n",
       " '半身裙',\n",
       " '连体裤',\n",
       " 'T恤',\n",
       " '针织衫/毛衣',\n",
       " '衬衫',\n",
       " '卫衣/绒衫',\n",
       " 'polo衫',\n",
       " '风衣',\n",
       " '运动卫衣/套头衫',\n",
       " '马甲',\n",
       " '棉衣',\n",
       " '运动茄克/外套',\n",
       " '大衣',\n",
       " '皮衣']"
      ]
     },
     "execution_count": 25,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#提取各品类名称\n",
    "product_name = df2['行业名称'].unique()\n",
    "industry_list = product_name.tolist()\n",
    "industry_list"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0      0.1289\n",
       "5      0.1201\n",
       "10     0.1097\n",
       "15     0.1254\n",
       "20     0.1274\n",
       "25     0.1247\n",
       "30     0.1293\n",
       "35     0.1237\n",
       "40     0.1262\n",
       "45     0.1103\n",
       "50     0.1242\n",
       "55     0.1247\n",
       "60     0.1239\n",
       "65     0.1279\n",
       "70     0.1243\n",
       "75     0.1125\n",
       "80     0.1181\n",
       "85     0.1262\n",
       "90     0.1090\n",
       "95     0.1165\n",
       "100    0.1247\n",
       "105    0.1091\n",
       "Name: 占比, dtype: float64"
      ]
     },
     "execution_count": 26,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#提取年龄段<18的各品类占比\n",
    "df2[df2['年龄段']=='<18']['占比']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[0.1289,\n",
       " 0.1201,\n",
       " 0.1097,\n",
       " 0.1254,\n",
       " 0.1274,\n",
       " 0.1247,\n",
       " 0.1293,\n",
       " 0.1237,\n",
       " 0.1262,\n",
       " 0.1103,\n",
       " 0.1242,\n",
       " 0.1247,\n",
       " 0.1239,\n",
       " 0.1279,\n",
       " 0.1243,\n",
       " 0.1125,\n",
       " 0.1181,\n",
       " 0.1262,\n",
       " 0.109,\n",
       " 0.1165,\n",
       " 0.1247,\n",
       " 0.1091]"
      ]
     },
     "execution_count": 27,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "list(df2[df2['年龄段']=='<18']['占比'])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "metadata": {},
   "outputs": [],
   "source": [
    "# 年龄段堆叠图：https://gallery.pyecharts.org/#/Bar/bar_stack1\n",
    "from pyecharts import options as opts\n",
    "from pyecharts.charts import Bar\n",
    "from pyecharts.faker import Faker\n",
    "\n",
    "c = (\n",
    "    Bar(init_opts=opts.InitOpts(width='1500xp'))\n",
    "    .add_xaxis(list(industry_list))\n",
    "    .add_yaxis(\"<18岁\", list(df2[df2['年龄段']=='<18']['占比']), stack=\"年龄段\")\n",
    "    .add_yaxis(\"18-24岁\", list(df2[df2['年龄段']=='18-24']['占比']), stack=\"年龄段\")\n",
    "    .add_yaxis(\"25-34岁\", list(df2[df2['年龄段']=='25-34']['占比']), stack=\"年龄段\")\n",
    "    .add_yaxis(\"35-44岁\", list(df2[df2['年龄段']=='35-44']['占比']), stack=\"年龄段\")\n",
    "    .add_yaxis(\">44岁\", list(df2[df2['年龄段']=='>44']['占比']), stack=\"年龄段\")\n",
    "    .set_series_opts(label_opts=opts.LabelOpts(is_show=False))\n",
    "    .set_global_opts(title_opts=opts.TitleOpts(title=\"各品类服饰年龄段分布\"),\n",
    "                     xaxis_opts=opts.AxisOpts(axislabel_opts=opts.LabelOpts(rotate=-25,interval=0,)))  #rotate=-25:标签逆时针旋转25°；interval=0:强制显示所有标签\n",
    ").render(\"服饰年龄分布.html\")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 服饰行业品类"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>日期维度</th>\n",
       "      <th>更新时间</th>\n",
       "      <th>行业id</th>\n",
       "      <th>行业名称</th>\n",
       "      <th>大类id</th>\n",
       "      <th>大类</th>\n",
       "      <th>Level</th>\n",
       "      <th>笔记篇数</th>\n",
       "      <th>活跃数</th>\n",
       "      <th>占比</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>近30天</td>\n",
       "      <td>2022-05-21 12:11:24</td>\n",
       "      <td>1698</td>\n",
       "      <td>连衣裙</td>\n",
       "      <td>1699</td>\n",
       "      <td>连衣裙</td>\n",
       "      <td>3</td>\n",
       "      <td>206428</td>\n",
       "      <td>42829237</td>\n",
       "      <td>1.00000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>近30天</td>\n",
       "      <td>2022-05-21 12:11:24</td>\n",
       "      <td>1707</td>\n",
       "      <td>夹克</td>\n",
       "      <td>1740</td>\n",
       "      <td>夹克</td>\n",
       "      <td>3</td>\n",
       "      <td>2117</td>\n",
       "      <td>366314</td>\n",
       "      <td>0.89932</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>近30天</td>\n",
       "      <td>2022-05-21 12:11:24</td>\n",
       "      <td>1707</td>\n",
       "      <td>夹克</td>\n",
       "      <td>3319</td>\n",
       "      <td>短外套</td>\n",
       "      <td>3</td>\n",
       "      <td>237</td>\n",
       "      <td>47446</td>\n",
       "      <td>0.10068</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>近30天</td>\n",
       "      <td>2022-05-21 12:11:24</td>\n",
       "      <td>1712</td>\n",
       "      <td>蕾丝雪纺衫</td>\n",
       "      <td>1713</td>\n",
       "      <td>蕾丝衫/雪纺衫</td>\n",
       "      <td>3</td>\n",
       "      <td>1043</td>\n",
       "      <td>207990</td>\n",
       "      <td>1.00000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>近30天</td>\n",
       "      <td>2022-05-21 12:11:24</td>\n",
       "      <td>1714</td>\n",
       "      <td>背心吊带</td>\n",
       "      <td>1715</td>\n",
       "      <td>背心/吊带</td>\n",
       "      <td>3</td>\n",
       "      <td>35855</td>\n",
       "      <td>13096759</td>\n",
       "      <td>1.00000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>近30天</td>\n",
       "      <td>2022-05-21 12:11:24</td>\n",
       "      <td>1716</td>\n",
       "      <td>西装西裤</td>\n",
       "      <td>1749</td>\n",
       "      <td>西服</td>\n",
       "      <td>3</td>\n",
       "      <td>7941</td>\n",
       "      <td>1026111</td>\n",
       "      <td>1.00000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>近30天</td>\n",
       "      <td>2022-05-21 12:11:24</td>\n",
       "      <td>1724</td>\n",
       "      <td>羽绒服</td>\n",
       "      <td>1725</td>\n",
       "      <td>羽绒服</td>\n",
       "      <td>3</td>\n",
       "      <td>1613</td>\n",
       "      <td>475102</td>\n",
       "      <td>1.00000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>近30天</td>\n",
       "      <td>2022-05-21 12:11:24</td>\n",
       "      <td>1726</td>\n",
       "      <td>牛仔裤</td>\n",
       "      <td>1727</td>\n",
       "      <td>牛仔裤</td>\n",
       "      <td>3</td>\n",
       "      <td>29270</td>\n",
       "      <td>8186246</td>\n",
       "      <td>1.00000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>近30天</td>\n",
       "      <td>2022-05-21 12:11:24</td>\n",
       "      <td>1728</td>\n",
       "      <td>休闲裤</td>\n",
       "      <td>1729</td>\n",
       "      <td>休闲裤</td>\n",
       "      <td>3</td>\n",
       "      <td>88872</td>\n",
       "      <td>24190034</td>\n",
       "      <td>1.00000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>近30天</td>\n",
       "      <td>2022-05-21 12:11:24</td>\n",
       "      <td>1730</td>\n",
       "      <td>半身裙</td>\n",
       "      <td>1731</td>\n",
       "      <td>半身裙</td>\n",
       "      <td>3</td>\n",
       "      <td>35114</td>\n",
       "      <td>9932457</td>\n",
       "      <td>1.00000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>近30天</td>\n",
       "      <td>2022-05-21 12:11:24</td>\n",
       "      <td>1732</td>\n",
       "      <td>连体裤</td>\n",
       "      <td>1733</td>\n",
       "      <td>连体裤</td>\n",
       "      <td>3</td>\n",
       "      <td>3586</td>\n",
       "      <td>908474</td>\n",
       "      <td>1.00000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>近30天</td>\n",
       "      <td>2022-05-21 12:11:24</td>\n",
       "      <td>1736</td>\n",
       "      <td>T恤</td>\n",
       "      <td>1736</td>\n",
       "      <td>T恤</td>\n",
       "      <td>2</td>\n",
       "      <td>132241</td>\n",
       "      <td>32963647</td>\n",
       "      <td>1.00000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>近30天</td>\n",
       "      <td>2022-05-21 12:11:24</td>\n",
       "      <td>1737</td>\n",
       "      <td>针织衫/毛衣</td>\n",
       "      <td>1737</td>\n",
       "      <td>针织衫/毛衣</td>\n",
       "      <td>2</td>\n",
       "      <td>23214</td>\n",
       "      <td>5953917</td>\n",
       "      <td>1.00000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>近30天</td>\n",
       "      <td>2022-05-21 12:11:24</td>\n",
       "      <td>1738</td>\n",
       "      <td>衬衫</td>\n",
       "      <td>1738</td>\n",
       "      <td>衬衫</td>\n",
       "      <td>2</td>\n",
       "      <td>50682</td>\n",
       "      <td>12900582</td>\n",
       "      <td>1.00000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>近30天</td>\n",
       "      <td>2022-05-21 12:11:24</td>\n",
       "      <td>1739</td>\n",
       "      <td>卫衣/绒衫</td>\n",
       "      <td>1739</td>\n",
       "      <td>卫衣/绒衫</td>\n",
       "      <td>2</td>\n",
       "      <td>6960</td>\n",
       "      <td>1750250</td>\n",
       "      <td>1.00000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>近30天</td>\n",
       "      <td>2022-05-21 12:11:24</td>\n",
       "      <td>1741</td>\n",
       "      <td>polo衫</td>\n",
       "      <td>1741</td>\n",
       "      <td>polo衫</td>\n",
       "      <td>2</td>\n",
       "      <td>3846</td>\n",
       "      <td>965825</td>\n",
       "      <td>1.00000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>近30天</td>\n",
       "      <td>2022-05-21 12:11:24</td>\n",
       "      <td>1742</td>\n",
       "      <td>风衣</td>\n",
       "      <td>1742</td>\n",
       "      <td>风衣</td>\n",
       "      <td>2</td>\n",
       "      <td>2328</td>\n",
       "      <td>340913</td>\n",
       "      <td>1.00000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>近30天</td>\n",
       "      <td>2022-05-21 12:11:24</td>\n",
       "      <td>1744</td>\n",
       "      <td>运动卫衣/套头衫</td>\n",
       "      <td>1744</td>\n",
       "      <td>运动卫衣/套头衫</td>\n",
       "      <td>2</td>\n",
       "      <td>402</td>\n",
       "      <td>56969</td>\n",
       "      <td>1.00000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>近30天</td>\n",
       "      <td>2022-05-21 12:11:24</td>\n",
       "      <td>1746</td>\n",
       "      <td>马甲</td>\n",
       "      <td>1746</td>\n",
       "      <td>马甲</td>\n",
       "      <td>2</td>\n",
       "      <td>10792</td>\n",
       "      <td>7900930</td>\n",
       "      <td>1.00000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19</th>\n",
       "      <td>近30天</td>\n",
       "      <td>2022-05-21 12:11:24</td>\n",
       "      <td>1747</td>\n",
       "      <td>棉衣</td>\n",
       "      <td>1747</td>\n",
       "      <td>棉衣</td>\n",
       "      <td>2</td>\n",
       "      <td>2372</td>\n",
       "      <td>617452</td>\n",
       "      <td>1.00000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20</th>\n",
       "      <td>近30天</td>\n",
       "      <td>2022-05-21 12:11:24</td>\n",
       "      <td>1748</td>\n",
       "      <td>运动茄克/外套</td>\n",
       "      <td>1748</td>\n",
       "      <td>运动茄克/外套</td>\n",
       "      <td>2</td>\n",
       "      <td>21145</td>\n",
       "      <td>5715367</td>\n",
       "      <td>1.00000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>21</th>\n",
       "      <td>近30天</td>\n",
       "      <td>2022-05-21 12:11:24</td>\n",
       "      <td>1750</td>\n",
       "      <td>大衣</td>\n",
       "      <td>1750</td>\n",
       "      <td>大衣</td>\n",
       "      <td>2</td>\n",
       "      <td>3595</td>\n",
       "      <td>990089</td>\n",
       "      <td>1.00000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>22</th>\n",
       "      <td>近30天</td>\n",
       "      <td>2022-05-21 12:11:24</td>\n",
       "      <td>3205</td>\n",
       "      <td>皮衣</td>\n",
       "      <td>3205</td>\n",
       "      <td>皮衣</td>\n",
       "      <td>2</td>\n",
       "      <td>1027</td>\n",
       "      <td>201677</td>\n",
       "      <td>1.00000</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "    日期维度                 更新时间  行业id      行业名称  大类id        大类  Level    笔记篇数  \\\n",
       "0   近30天  2022-05-21 12:11:24  1698       连衣裙  1699       连衣裙      3  206428   \n",
       "1   近30天  2022-05-21 12:11:24  1707        夹克  1740        夹克      3    2117   \n",
       "2   近30天  2022-05-21 12:11:24  1707        夹克  3319       短外套      3     237   \n",
       "3   近30天  2022-05-21 12:11:24  1712     蕾丝雪纺衫  1713   蕾丝衫/雪纺衫      3    1043   \n",
       "4   近30天  2022-05-21 12:11:24  1714      背心吊带  1715     背心/吊带      3   35855   \n",
       "5   近30天  2022-05-21 12:11:24  1716      西装西裤  1749        西服      3    7941   \n",
       "6   近30天  2022-05-21 12:11:24  1724       羽绒服  1725       羽绒服      3    1613   \n",
       "7   近30天  2022-05-21 12:11:24  1726       牛仔裤  1727       牛仔裤      3   29270   \n",
       "8   近30天  2022-05-21 12:11:24  1728       休闲裤  1729       休闲裤      3   88872   \n",
       "9   近30天  2022-05-21 12:11:24  1730       半身裙  1731       半身裙      3   35114   \n",
       "10  近30天  2022-05-21 12:11:24  1732       连体裤  1733       连体裤      3    3586   \n",
       "11  近30天  2022-05-21 12:11:24  1736        T恤  1736        T恤      2  132241   \n",
       "12  近30天  2022-05-21 12:11:24  1737    针织衫/毛衣  1737    针织衫/毛衣      2   23214   \n",
       "13  近30天  2022-05-21 12:11:24  1738        衬衫  1738        衬衫      2   50682   \n",
       "14  近30天  2022-05-21 12:11:24  1739     卫衣/绒衫  1739     卫衣/绒衫      2    6960   \n",
       "15  近30天  2022-05-21 12:11:24  1741     polo衫  1741     polo衫      2    3846   \n",
       "16  近30天  2022-05-21 12:11:24  1742        风衣  1742        风衣      2    2328   \n",
       "17  近30天  2022-05-21 12:11:24  1744  运动卫衣/套头衫  1744  运动卫衣/套头衫      2     402   \n",
       "18  近30天  2022-05-21 12:11:24  1746        马甲  1746        马甲      2   10792   \n",
       "19  近30天  2022-05-21 12:11:24  1747        棉衣  1747        棉衣      2    2372   \n",
       "20  近30天  2022-05-21 12:11:24  1748   运动茄克/外套  1748   运动茄克/外套      2   21145   \n",
       "21  近30天  2022-05-21 12:11:24  1750        大衣  1750        大衣      2    3595   \n",
       "22  近30天  2022-05-21 12:11:24  3205        皮衣  3205        皮衣      2    1027   \n",
       "\n",
       "         活跃数       占比  \n",
       "0   42829237  1.00000  \n",
       "1     366314  0.89932  \n",
       "2      47446  0.10068  \n",
       "3     207990  1.00000  \n",
       "4   13096759  1.00000  \n",
       "5    1026111  1.00000  \n",
       "6     475102  1.00000  \n",
       "7    8186246  1.00000  \n",
       "8   24190034  1.00000  \n",
       "9    9932457  1.00000  \n",
       "10    908474  1.00000  \n",
       "11  32963647  1.00000  \n",
       "12   5953917  1.00000  \n",
       "13  12900582  1.00000  \n",
       "14   1750250  1.00000  \n",
       "15    965825  1.00000  \n",
       "16    340913  1.00000  \n",
       "17     56969  1.00000  \n",
       "18   7900930  1.00000  \n",
       "19    617452  1.00000  \n",
       "20   5715367  1.00000  \n",
       "21    990089  1.00000  \n",
       "22    201677  1.00000  "
      ]
     },
     "execution_count": 29,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#导入数据\n",
    "df7=pd.read_excel('服饰行业品类分析-大类占比.xlsx')\n",
    "df7"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "<class 'pandas.core.frame.DataFrame'>\n",
      "RangeIndex: 23 entries, 0 to 22\n",
      "Data columns (total 10 columns):\n",
      " #   Column  Non-Null Count  Dtype  \n",
      "---  ------  --------------  -----  \n",
      " 0   日期维度    23 non-null     object \n",
      " 1   更新时间    23 non-null     object \n",
      " 2   行业id    23 non-null     int64  \n",
      " 3   行业名称    23 non-null     object \n",
      " 4   大类id    23 non-null     int64  \n",
      " 5   大类      23 non-null     object \n",
      " 6   Level   23 non-null     int64  \n",
      " 7   笔记篇数    23 non-null     int64  \n",
      " 8   活跃数     23 non-null     int64  \n",
      " 9   占比      23 non-null     float64\n",
      "dtypes: float64(1), int64(5), object(4)\n",
      "memory usage: 1.9+ KB\n"
     ]
    }
   ],
   "source": [
    "# 查看数据信息\n",
    "df7.info()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>日期维度</th>\n",
       "      <th>更新时间</th>\n",
       "      <th>行业id</th>\n",
       "      <th>行业名称</th>\n",
       "      <th>大类id</th>\n",
       "      <th>大类</th>\n",
       "      <th>Level</th>\n",
       "      <th>笔记篇数</th>\n",
       "      <th>活跃数</th>\n",
       "      <th>占比</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>近30天</td>\n",
       "      <td>2022-05-21 12:11:24</td>\n",
       "      <td>1698</td>\n",
       "      <td>连衣裙</td>\n",
       "      <td>1699</td>\n",
       "      <td>连衣裙</td>\n",
       "      <td>3</td>\n",
       "      <td>206428</td>\n",
       "      <td>42829237</td>\n",
       "      <td>1.00000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>近30天</td>\n",
       "      <td>2022-05-21 12:11:24</td>\n",
       "      <td>1736</td>\n",
       "      <td>T恤</td>\n",
       "      <td>1736</td>\n",
       "      <td>T恤</td>\n",
       "      <td>2</td>\n",
       "      <td>132241</td>\n",
       "      <td>32963647</td>\n",
       "      <td>1.00000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>近30天</td>\n",
       "      <td>2022-05-21 12:11:24</td>\n",
       "      <td>1728</td>\n",
       "      <td>休闲裤</td>\n",
       "      <td>1729</td>\n",
       "      <td>休闲裤</td>\n",
       "      <td>3</td>\n",
       "      <td>88872</td>\n",
       "      <td>24190034</td>\n",
       "      <td>1.00000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>近30天</td>\n",
       "      <td>2022-05-21 12:11:24</td>\n",
       "      <td>1738</td>\n",
       "      <td>衬衫</td>\n",
       "      <td>1738</td>\n",
       "      <td>衬衫</td>\n",
       "      <td>2</td>\n",
       "      <td>50682</td>\n",
       "      <td>12900582</td>\n",
       "      <td>1.00000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>近30天</td>\n",
       "      <td>2022-05-21 12:11:24</td>\n",
       "      <td>1714</td>\n",
       "      <td>背心吊带</td>\n",
       "      <td>1715</td>\n",
       "      <td>背心/吊带</td>\n",
       "      <td>3</td>\n",
       "      <td>35855</td>\n",
       "      <td>13096759</td>\n",
       "      <td>1.00000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>近30天</td>\n",
       "      <td>2022-05-21 12:11:24</td>\n",
       "      <td>1730</td>\n",
       "      <td>半身裙</td>\n",
       "      <td>1731</td>\n",
       "      <td>半身裙</td>\n",
       "      <td>3</td>\n",
       "      <td>35114</td>\n",
       "      <td>9932457</td>\n",
       "      <td>1.00000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>近30天</td>\n",
       "      <td>2022-05-21 12:11:24</td>\n",
       "      <td>1726</td>\n",
       "      <td>牛仔裤</td>\n",
       "      <td>1727</td>\n",
       "      <td>牛仔裤</td>\n",
       "      <td>3</td>\n",
       "      <td>29270</td>\n",
       "      <td>8186246</td>\n",
       "      <td>1.00000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>近30天</td>\n",
       "      <td>2022-05-21 12:11:24</td>\n",
       "      <td>1737</td>\n",
       "      <td>针织衫/毛衣</td>\n",
       "      <td>1737</td>\n",
       "      <td>针织衫/毛衣</td>\n",
       "      <td>2</td>\n",
       "      <td>23214</td>\n",
       "      <td>5953917</td>\n",
       "      <td>1.00000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20</th>\n",
       "      <td>近30天</td>\n",
       "      <td>2022-05-21 12:11:24</td>\n",
       "      <td>1748</td>\n",
       "      <td>运动茄克/外套</td>\n",
       "      <td>1748</td>\n",
       "      <td>运动茄克/外套</td>\n",
       "      <td>2</td>\n",
       "      <td>21145</td>\n",
       "      <td>5715367</td>\n",
       "      <td>1.00000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>近30天</td>\n",
       "      <td>2022-05-21 12:11:24</td>\n",
       "      <td>1746</td>\n",
       "      <td>马甲</td>\n",
       "      <td>1746</td>\n",
       "      <td>马甲</td>\n",
       "      <td>2</td>\n",
       "      <td>10792</td>\n",
       "      <td>7900930</td>\n",
       "      <td>1.00000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>近30天</td>\n",
       "      <td>2022-05-21 12:11:24</td>\n",
       "      <td>1716</td>\n",
       "      <td>西装西裤</td>\n",
       "      <td>1749</td>\n",
       "      <td>西服</td>\n",
       "      <td>3</td>\n",
       "      <td>7941</td>\n",
       "      <td>1026111</td>\n",
       "      <td>1.00000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>近30天</td>\n",
       "      <td>2022-05-21 12:11:24</td>\n",
       "      <td>1739</td>\n",
       "      <td>卫衣/绒衫</td>\n",
       "      <td>1739</td>\n",
       "      <td>卫衣/绒衫</td>\n",
       "      <td>2</td>\n",
       "      <td>6960</td>\n",
       "      <td>1750250</td>\n",
       "      <td>1.00000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>近30天</td>\n",
       "      <td>2022-05-21 12:11:24</td>\n",
       "      <td>1741</td>\n",
       "      <td>polo衫</td>\n",
       "      <td>1741</td>\n",
       "      <td>polo衫</td>\n",
       "      <td>2</td>\n",
       "      <td>3846</td>\n",
       "      <td>965825</td>\n",
       "      <td>1.00000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>21</th>\n",
       "      <td>近30天</td>\n",
       "      <td>2022-05-21 12:11:24</td>\n",
       "      <td>1750</td>\n",
       "      <td>大衣</td>\n",
       "      <td>1750</td>\n",
       "      <td>大衣</td>\n",
       "      <td>2</td>\n",
       "      <td>3595</td>\n",
       "      <td>990089</td>\n",
       "      <td>1.00000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>近30天</td>\n",
       "      <td>2022-05-21 12:11:24</td>\n",
       "      <td>1732</td>\n",
       "      <td>连体裤</td>\n",
       "      <td>1733</td>\n",
       "      <td>连体裤</td>\n",
       "      <td>3</td>\n",
       "      <td>3586</td>\n",
       "      <td>908474</td>\n",
       "      <td>1.00000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19</th>\n",
       "      <td>近30天</td>\n",
       "      <td>2022-05-21 12:11:24</td>\n",
       "      <td>1747</td>\n",
       "      <td>棉衣</td>\n",
       "      <td>1747</td>\n",
       "      <td>棉衣</td>\n",
       "      <td>2</td>\n",
       "      <td>2372</td>\n",
       "      <td>617452</td>\n",
       "      <td>1.00000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>近30天</td>\n",
       "      <td>2022-05-21 12:11:24</td>\n",
       "      <td>1742</td>\n",
       "      <td>风衣</td>\n",
       "      <td>1742</td>\n",
       "      <td>风衣</td>\n",
       "      <td>2</td>\n",
       "      <td>2328</td>\n",
       "      <td>340913</td>\n",
       "      <td>1.00000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>近30天</td>\n",
       "      <td>2022-05-21 12:11:24</td>\n",
       "      <td>1707</td>\n",
       "      <td>夹克</td>\n",
       "      <td>1740</td>\n",
       "      <td>夹克</td>\n",
       "      <td>3</td>\n",
       "      <td>2117</td>\n",
       "      <td>366314</td>\n",
       "      <td>0.89932</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>近30天</td>\n",
       "      <td>2022-05-21 12:11:24</td>\n",
       "      <td>1724</td>\n",
       "      <td>羽绒服</td>\n",
       "      <td>1725</td>\n",
       "      <td>羽绒服</td>\n",
       "      <td>3</td>\n",
       "      <td>1613</td>\n",
       "      <td>475102</td>\n",
       "      <td>1.00000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>近30天</td>\n",
       "      <td>2022-05-21 12:11:24</td>\n",
       "      <td>1712</td>\n",
       "      <td>蕾丝雪纺衫</td>\n",
       "      <td>1713</td>\n",
       "      <td>蕾丝衫/雪纺衫</td>\n",
       "      <td>3</td>\n",
       "      <td>1043</td>\n",
       "      <td>207990</td>\n",
       "      <td>1.00000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>22</th>\n",
       "      <td>近30天</td>\n",
       "      <td>2022-05-21 12:11:24</td>\n",
       "      <td>3205</td>\n",
       "      <td>皮衣</td>\n",
       "      <td>3205</td>\n",
       "      <td>皮衣</td>\n",
       "      <td>2</td>\n",
       "      <td>1027</td>\n",
       "      <td>201677</td>\n",
       "      <td>1.00000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>近30天</td>\n",
       "      <td>2022-05-21 12:11:24</td>\n",
       "      <td>1744</td>\n",
       "      <td>运动卫衣/套头衫</td>\n",
       "      <td>1744</td>\n",
       "      <td>运动卫衣/套头衫</td>\n",
       "      <td>2</td>\n",
       "      <td>402</td>\n",
       "      <td>56969</td>\n",
       "      <td>1.00000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>近30天</td>\n",
       "      <td>2022-05-21 12:11:24</td>\n",
       "      <td>1707</td>\n",
       "      <td>夹克</td>\n",
       "      <td>3319</td>\n",
       "      <td>短外套</td>\n",
       "      <td>3</td>\n",
       "      <td>237</td>\n",
       "      <td>47446</td>\n",
       "      <td>0.10068</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "    日期维度                 更新时间  行业id      行业名称  大类id        大类  Level    笔记篇数  \\\n",
       "0   近30天  2022-05-21 12:11:24  1698       连衣裙  1699       连衣裙      3  206428   \n",
       "11  近30天  2022-05-21 12:11:24  1736        T恤  1736        T恤      2  132241   \n",
       "8   近30天  2022-05-21 12:11:24  1728       休闲裤  1729       休闲裤      3   88872   \n",
       "13  近30天  2022-05-21 12:11:24  1738        衬衫  1738        衬衫      2   50682   \n",
       "4   近30天  2022-05-21 12:11:24  1714      背心吊带  1715     背心/吊带      3   35855   \n",
       "9   近30天  2022-05-21 12:11:24  1730       半身裙  1731       半身裙      3   35114   \n",
       "7   近30天  2022-05-21 12:11:24  1726       牛仔裤  1727       牛仔裤      3   29270   \n",
       "12  近30天  2022-05-21 12:11:24  1737    针织衫/毛衣  1737    针织衫/毛衣      2   23214   \n",
       "20  近30天  2022-05-21 12:11:24  1748   运动茄克/外套  1748   运动茄克/外套      2   21145   \n",
       "18  近30天  2022-05-21 12:11:24  1746        马甲  1746        马甲      2   10792   \n",
       "5   近30天  2022-05-21 12:11:24  1716      西装西裤  1749        西服      3    7941   \n",
       "14  近30天  2022-05-21 12:11:24  1739     卫衣/绒衫  1739     卫衣/绒衫      2    6960   \n",
       "15  近30天  2022-05-21 12:11:24  1741     polo衫  1741     polo衫      2    3846   \n",
       "21  近30天  2022-05-21 12:11:24  1750        大衣  1750        大衣      2    3595   \n",
       "10  近30天  2022-05-21 12:11:24  1732       连体裤  1733       连体裤      3    3586   \n",
       "19  近30天  2022-05-21 12:11:24  1747        棉衣  1747        棉衣      2    2372   \n",
       "16  近30天  2022-05-21 12:11:24  1742        风衣  1742        风衣      2    2328   \n",
       "1   近30天  2022-05-21 12:11:24  1707        夹克  1740        夹克      3    2117   \n",
       "6   近30天  2022-05-21 12:11:24  1724       羽绒服  1725       羽绒服      3    1613   \n",
       "3   近30天  2022-05-21 12:11:24  1712     蕾丝雪纺衫  1713   蕾丝衫/雪纺衫      3    1043   \n",
       "22  近30天  2022-05-21 12:11:24  3205        皮衣  3205        皮衣      2    1027   \n",
       "17  近30天  2022-05-21 12:11:24  1744  运动卫衣/套头衫  1744  运动卫衣/套头衫      2     402   \n",
       "2   近30天  2022-05-21 12:11:24  1707        夹克  3319       短外套      3     237   \n",
       "\n",
       "         活跃数       占比  \n",
       "0   42829237  1.00000  \n",
       "11  32963647  1.00000  \n",
       "8   24190034  1.00000  \n",
       "13  12900582  1.00000  \n",
       "4   13096759  1.00000  \n",
       "9    9932457  1.00000  \n",
       "7    8186246  1.00000  \n",
       "12   5953917  1.00000  \n",
       "20   5715367  1.00000  \n",
       "18   7900930  1.00000  \n",
       "5    1026111  1.00000  \n",
       "14   1750250  1.00000  \n",
       "15    965825  1.00000  \n",
       "21    990089  1.00000  \n",
       "10    908474  1.00000  \n",
       "19    617452  1.00000  \n",
       "16    340913  1.00000  \n",
       "1     366314  0.89932  \n",
       "6     475102  1.00000  \n",
       "3     207990  1.00000  \n",
       "22    201677  1.00000  \n",
       "17     56969  1.00000  \n",
       "2      47446  0.10068  "
      ]
     },
     "execution_count": 31,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#笔记篇数由多到少排列\n",
    "df_biji = df7.sort_values(by='笔记篇数', ascending=False)\n",
    "df_biji"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 32,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['连衣裙',\n",
       " 'T恤',\n",
       " '休闲裤',\n",
       " '衬衫',\n",
       " '背心/吊带',\n",
       " '半身裙',\n",
       " '牛仔裤',\n",
       " '针织衫/毛衣',\n",
       " '运动茄克/外套',\n",
       " '马甲',\n",
       " '西服',\n",
       " '卫衣/绒衫',\n",
       " 'polo衫',\n",
       " '大衣',\n",
       " '连体裤',\n",
       " '棉衣',\n",
       " '风衣',\n",
       " '夹克',\n",
       " '羽绒服',\n",
       " '蕾丝衫/雪纺衫',\n",
       " '皮衣',\n",
       " '运动卫衣/套头衫',\n",
       " '短外套']"
      ]
     },
     "execution_count": 32,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "dalei_list = df_biji['大类'].tolist()\n",
    "dalei_list"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 33,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[206428,\n",
       " 132241,\n",
       " 88872,\n",
       " 50682,\n",
       " 35855,\n",
       " 35114,\n",
       " 29270,\n",
       " 23214,\n",
       " 21145,\n",
       " 10792,\n",
       " 7941,\n",
       " 6960,\n",
       " 3846,\n",
       " 3595,\n",
       " 3586,\n",
       " 2372,\n",
       " 2328,\n",
       " 2117,\n",
       " 1613,\n",
       " 1043,\n",
       " 1027,\n",
       " 402,\n",
       " 237]"
      ]
     },
     "execution_count": 33,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "biji_list = df_biji['笔记篇数'].tolist()\n",
    "biji_list"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### 数据可视化"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 34,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts':'http://localhost:8888/nbextensions/assets/echarts.min'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "\n",
       "        <div id=\"1eacd9558da14123bf9ea9ae950b30bb\" style=\"width:900px; height:500px;\"></div>\n",
       "\n",
       "<script>\n",
       "        require(['echarts'], function(echarts) {\n",
       "                var chart_1eacd9558da14123bf9ea9ae950b30bb = echarts.init(\n",
       "                    document.getElementById('1eacd9558da14123bf9ea9ae950b30bb'), 'white', {renderer: 'canvas'});\n",
       "                var option_1eacd9558da14123bf9ea9ae950b30bb = {\n",
       "    \"animation\": true,\n",
       "    \"animationThreshold\": 2000,\n",
       "    \"animationDuration\": 1000,\n",
       "    \"animationEasing\": \"cubicOut\",\n",
       "    \"animationDelay\": 0,\n",
       "    \"animationDurationUpdate\": 300,\n",
       "    \"animationEasingUpdate\": \"cubicOut\",\n",
       "    \"animationDelayUpdate\": 0,\n",
       "    \"color\": [\n",
       "        \"#c23531\",\n",
       "        \"#2f4554\",\n",
       "        \"#61a0a8\",\n",
       "        \"#d48265\",\n",
       "        \"#749f83\",\n",
       "        \"#ca8622\",\n",
       "        \"#bda29a\",\n",
       "        \"#6e7074\",\n",
       "        \"#546570\",\n",
       "        \"#c4ccd3\",\n",
       "        \"#f05b72\",\n",
       "        \"#ef5b9c\",\n",
       "        \"#f47920\",\n",
       "        \"#905a3d\",\n",
       "        \"#fab27b\",\n",
       "        \"#2a5caa\",\n",
       "        \"#444693\",\n",
       "        \"#726930\",\n",
       "        \"#b2d235\",\n",
       "        \"#6d8346\",\n",
       "        \"#ac6767\",\n",
       "        \"#1d953f\",\n",
       "        \"#6950a1\",\n",
       "        \"#918597\"\n",
       "    ],\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"bar\",\n",
       "            \"name\": \"\\u7bc7\\u6570\",\n",
       "            \"legendHoverLink\": true,\n",
       "            \"data\": [\n",
       "                206428,\n",
       "                132241,\n",
       "                88872,\n",
       "                50682,\n",
       "                35855,\n",
       "                35114,\n",
       "                29270,\n",
       "                23214,\n",
       "                21145,\n",
       "                10792,\n",
       "                7941,\n",
       "                6960,\n",
       "                3846,\n",
       "                3595,\n",
       "                3586,\n",
       "                2372,\n",
       "                2328,\n",
       "                2117,\n",
       "                1613,\n",
       "                1043,\n",
       "                1027,\n",
       "                402,\n",
       "                237\n",
       "            ],\n",
       "            \"showBackground\": false,\n",
       "            \"barMinHeight\": 0,\n",
       "            \"barCategoryGap\": \"20%\",\n",
       "            \"barGap\": \"30%\",\n",
       "            \"large\": false,\n",
       "            \"largeThreshold\": 400,\n",
       "            \"seriesLayoutBy\": \"column\",\n",
       "            \"datasetIndex\": 0,\n",
       "            \"clip\": true,\n",
       "            \"zlevel\": 0,\n",
       "            \"z\": 2,\n",
       "            \"label\": {\n",
       "                \"show\": true,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"\\u7bc7\\u6570\"\n",
       "            ],\n",
       "            \"selected\": {\n",
       "                \"\\u7bc7\\u6570\": true\n",
       "            },\n",
       "            \"show\": true,\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10,\n",
       "            \"itemWidth\": 25,\n",
       "            \"itemHeight\": 14\n",
       "        }\n",
       "    ],\n",
       "    \"tooltip\": {\n",
       "        \"show\": true,\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"showContent\": true,\n",
       "        \"alwaysShowContent\": false,\n",
       "        \"showDelay\": 0,\n",
       "        \"hideDelay\": 100,\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"borderWidth\": 0,\n",
       "        \"padding\": 5\n",
       "    },\n",
       "    \"xAxis\": [\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 0,\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": false,\n",
       "                \"lineStyle\": {\n",
       "                    \"show\": true,\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            },\n",
       "            \"data\": [\n",
       "                \"\\u8fde\\u8863\\u88d9\",\n",
       "                \"T\\u6064\",\n",
       "                \"\\u4f11\\u95f2\\u88e4\",\n",
       "                \"\\u886c\\u886b\",\n",
       "                \"\\u80cc\\u5fc3/\\u540a\\u5e26\",\n",
       "                \"\\u534a\\u8eab\\u88d9\",\n",
       "                \"\\u725b\\u4ed4\\u88e4\",\n",
       "                \"\\u9488\\u7ec7\\u886b/\\u6bdb\\u8863\",\n",
       "                \"\\u8fd0\\u52a8\\u8304\\u514b/\\u5916\\u5957\",\n",
       "                \"\\u9a6c\\u7532\",\n",
       "                \"\\u897f\\u670d\",\n",
       "                \"\\u536b\\u8863/\\u7ed2\\u886b\",\n",
       "                \"polo\\u886b\",\n",
       "                \"\\u5927\\u8863\",\n",
       "                \"\\u8fde\\u4f53\\u88e4\",\n",
       "                \"\\u68c9\\u8863\",\n",
       "                \"\\u98ce\\u8863\",\n",
       "                \"\\u5939\\u514b\",\n",
       "                \"\\u7fbd\\u7ed2\\u670d\",\n",
       "                \"\\u857e\\u4e1d\\u886b/\\u96ea\\u7eba\\u886b\",\n",
       "                \"\\u76ae\\u8863\",\n",
       "                \"\\u8fd0\\u52a8\\u536b\\u8863/\\u5957\\u5934\\u886b\",\n",
       "                \"\\u77ed\\u5916\\u5957\"\n",
       "            ]\n",
       "        }\n",
       "    ],\n",
       "    \"yAxis\": [\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 0,\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": false,\n",
       "                \"lineStyle\": {\n",
       "                    \"show\": true,\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"title\": [\n",
       "        {\n",
       "            \"text\": \"\\u670d\\u9970\\u7c7b\\u7b14\\u8bb0\\u7bc7\\u6570\\u6392\\u540d\",\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10\n",
       "        }\n",
       "    ],\n",
       "    \"dataZoom\": {\n",
       "        \"show\": true,\n",
       "        \"type\": \"slider\",\n",
       "        \"realtime\": true,\n",
       "        \"start\": 20,\n",
       "        \"end\": 80,\n",
       "        \"orient\": \"horizontal\",\n",
       "        \"zoomLock\": false,\n",
       "        \"filterMode\": \"filter\"\n",
       "    }\n",
       "};\n",
       "                chart_1eacd9558da14123bf9ea9ae950b30bb.setOption(option_1eacd9558da14123bf9ea9ae950b30bb);\n",
       "        });\n",
       "    </script>\n"
      ],
      "text/plain": [
       "<pyecharts.render.display.HTML at 0x1e5d00694c0>"
      ]
     },
     "execution_count": 34,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#滑动柱状图：https://gallery.pyecharts.org/#/Bar/bar_datazoom_both\n",
    "from pyecharts import options as opts\n",
    "from pyecharts.charts import Bar\n",
    "\n",
    "c = (\n",
    "    Bar()\n",
    "    .add_xaxis(dalei_list)\n",
    "    .add_yaxis(\"篇数\",biji_list)\n",
    "    .set_global_opts(\n",
    "        title_opts=opts.TitleOpts(title=\"服饰类笔记篇数排名\"),\n",
    "        datazoom_opts=opts.DataZoomOpts())\n",
    "    )\n",
    "c.render_notebook()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 35,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>日期维度</th>\n",
       "      <th>日期</th>\n",
       "      <th>行业名称</th>\n",
       "      <th>当日笔记篇数</th>\n",
       "      <th>当日点赞数</th>\n",
       "      <th>当日收藏数</th>\n",
       "      <th>当日评论数</th>\n",
       "      <th>平均互动量</th>\n",
       "      <th>当日分享数</th>\n",
       "      <th>当日阅读数</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>近30天</td>\n",
       "      <td>20220421</td>\n",
       "      <td>连衣裙</td>\n",
       "      <td>8105</td>\n",
       "      <td>1526348</td>\n",
       "      <td>665187</td>\n",
       "      <td>131935</td>\n",
       "      <td>286</td>\n",
       "      <td>61854</td>\n",
       "      <td>41744057</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>近30天</td>\n",
       "      <td>20220422</td>\n",
       "      <td>连衣裙</td>\n",
       "      <td>8035</td>\n",
       "      <td>1554701</td>\n",
       "      <td>552797</td>\n",
       "      <td>125601</td>\n",
       "      <td>277</td>\n",
       "      <td>47520</td>\n",
       "      <td>46552553</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>近30天</td>\n",
       "      <td>20220423</td>\n",
       "      <td>连衣裙</td>\n",
       "      <td>7316</td>\n",
       "      <td>1810782</td>\n",
       "      <td>786336</td>\n",
       "      <td>103045</td>\n",
       "      <td>369</td>\n",
       "      <td>47970</td>\n",
       "      <td>41423076</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>近30天</td>\n",
       "      <td>20220424</td>\n",
       "      <td>连衣裙</td>\n",
       "      <td>7532</td>\n",
       "      <td>1140351</td>\n",
       "      <td>410110</td>\n",
       "      <td>105321</td>\n",
       "      <td>219</td>\n",
       "      <td>39080</td>\n",
       "      <td>29430429</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>近30天</td>\n",
       "      <td>20220425</td>\n",
       "      <td>连衣裙</td>\n",
       "      <td>7985</td>\n",
       "      <td>1482300</td>\n",
       "      <td>530420</td>\n",
       "      <td>109004</td>\n",
       "      <td>265</td>\n",
       "      <td>50805</td>\n",
       "      <td>39122846</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>655</th>\n",
       "      <td>近30天</td>\n",
       "      <td>20220516</td>\n",
       "      <td>皮衣</td>\n",
       "      <td>34</td>\n",
       "      <td>930</td>\n",
       "      <td>279</td>\n",
       "      <td>350</td>\n",
       "      <td>45</td>\n",
       "      <td>44</td>\n",
       "      <td>23367</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>656</th>\n",
       "      <td>近30天</td>\n",
       "      <td>20220517</td>\n",
       "      <td>皮衣</td>\n",
       "      <td>21</td>\n",
       "      <td>2416</td>\n",
       "      <td>728</td>\n",
       "      <td>225</td>\n",
       "      <td>160</td>\n",
       "      <td>51</td>\n",
       "      <td>85163</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>657</th>\n",
       "      <td>近30天</td>\n",
       "      <td>20220518</td>\n",
       "      <td>皮衣</td>\n",
       "      <td>32</td>\n",
       "      <td>3468</td>\n",
       "      <td>647</td>\n",
       "      <td>348</td>\n",
       "      <td>139</td>\n",
       "      <td>72</td>\n",
       "      <td>42835</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>658</th>\n",
       "      <td>近30天</td>\n",
       "      <td>20220519</td>\n",
       "      <td>皮衣</td>\n",
       "      <td>30</td>\n",
       "      <td>1032</td>\n",
       "      <td>253</td>\n",
       "      <td>409</td>\n",
       "      <td>56</td>\n",
       "      <td>33</td>\n",
       "      <td>15166</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>659</th>\n",
       "      <td>近30天</td>\n",
       "      <td>20220520</td>\n",
       "      <td>皮衣</td>\n",
       "      <td>31</td>\n",
       "      <td>2995</td>\n",
       "      <td>839</td>\n",
       "      <td>269</td>\n",
       "      <td>132</td>\n",
       "      <td>81</td>\n",
       "      <td>161842</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>660 rows × 10 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "     日期维度        日期 行业名称  当日笔记篇数    当日点赞数   当日收藏数   当日评论数  平均互动量  当日分享数  \\\n",
       "0    近30天  20220421  连衣裙    8105  1526348  665187  131935    286  61854   \n",
       "1    近30天  20220422  连衣裙    8035  1554701  552797  125601    277  47520   \n",
       "2    近30天  20220423  连衣裙    7316  1810782  786336  103045    369  47970   \n",
       "3    近30天  20220424  连衣裙    7532  1140351  410110  105321    219  39080   \n",
       "4    近30天  20220425  连衣裙    7985  1482300  530420  109004    265  50805   \n",
       "..    ...       ...  ...     ...      ...     ...     ...    ...    ...   \n",
       "655  近30天  20220516   皮衣      34      930     279     350     45     44   \n",
       "656  近30天  20220517   皮衣      21     2416     728     225    160     51   \n",
       "657  近30天  20220518   皮衣      32     3468     647     348    139     72   \n",
       "658  近30天  20220519   皮衣      30     1032     253     409     56     33   \n",
       "659  近30天  20220520   皮衣      31     2995     839     269    132     81   \n",
       "\n",
       "        当日阅读数  \n",
       "0    41744057  \n",
       "1    46552553  \n",
       "2    41423076  \n",
       "3    29430429  \n",
       "4    39122846  \n",
       "..        ...  \n",
       "655     23367  \n",
       "656     85163  \n",
       "657     42835  \n",
       "658     15166  \n",
       "659    161842  \n",
       "\n",
       "[660 rows x 10 columns]"
      ]
     },
     "execution_count": 35,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#导入数据\n",
    "df8=pd.read_excel('服饰行业笔记数据趋势.xlsx')\n",
    "df8"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "clothes_name = df8['行业名称'].unique()\n",
    "clothes_name.tolist()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 36,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>行业名称</th>\n",
       "      <th>当日笔记篇数</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>T恤</td>\n",
       "      <td>4408.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>polo衫</td>\n",
       "      <td>128.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>休闲裤</td>\n",
       "      <td>2980.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>半身裙</td>\n",
       "      <td>1246.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>卫衣/绒衫</td>\n",
       "      <td>232.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>大衣</td>\n",
       "      <td>120.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>夹克</td>\n",
       "      <td>78.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>棉衣</td>\n",
       "      <td>79.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>牛仔裤</td>\n",
       "      <td>976.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>皮衣</td>\n",
       "      <td>34.0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "    行业名称  当日笔记篇数\n",
       "0     T恤  4408.0\n",
       "1  polo衫   128.0\n",
       "2    休闲裤  2980.0\n",
       "3    半身裙  1246.0\n",
       "4  卫衣/绒衫   232.0\n",
       "5     大衣   120.0\n",
       "6     夹克    78.0\n",
       "7     棉衣    79.0\n",
       "8    牛仔裤   976.0\n",
       "9     皮衣    34.0"
      ]
     },
     "execution_count": 36,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "biji_count=df8.groupby('行业名称')['当日笔记篇数'].mean().reset_index()  #分别聚合各品类一个月来的笔记篇数，计算出平均值\n",
    "biji_count['当日笔记篇数']=round(biji_count['当日笔记篇数'],0)  #四舍五入笔记篇数，方便观看\n",
    "biji_count.head(10)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 热门笔记分析"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 37,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>日期维度</th>\n",
       "      <th>日期</th>\n",
       "      <th>行业名称</th>\n",
       "      <th>当日笔记篇数</th>\n",
       "      <th>当日点赞数</th>\n",
       "      <th>当日收藏数</th>\n",
       "      <th>当日评论数</th>\n",
       "      <th>平均互动量</th>\n",
       "      <th>当日分享数</th>\n",
       "      <th>当日阅读数</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>近30天</td>\n",
       "      <td>20220421</td>\n",
       "      <td>连衣裙</td>\n",
       "      <td>8105</td>\n",
       "      <td>1526348</td>\n",
       "      <td>665187</td>\n",
       "      <td>131935</td>\n",
       "      <td>286</td>\n",
       "      <td>61854</td>\n",
       "      <td>41744057</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>近30天</td>\n",
       "      <td>20220422</td>\n",
       "      <td>连衣裙</td>\n",
       "      <td>8035</td>\n",
       "      <td>1554701</td>\n",
       "      <td>552797</td>\n",
       "      <td>125601</td>\n",
       "      <td>277</td>\n",
       "      <td>47520</td>\n",
       "      <td>46552553</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>近30天</td>\n",
       "      <td>20220423</td>\n",
       "      <td>连衣裙</td>\n",
       "      <td>7316</td>\n",
       "      <td>1810782</td>\n",
       "      <td>786336</td>\n",
       "      <td>103045</td>\n",
       "      <td>369</td>\n",
       "      <td>47970</td>\n",
       "      <td>41423076</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>近30天</td>\n",
       "      <td>20220424</td>\n",
       "      <td>连衣裙</td>\n",
       "      <td>7532</td>\n",
       "      <td>1140351</td>\n",
       "      <td>410110</td>\n",
       "      <td>105321</td>\n",
       "      <td>219</td>\n",
       "      <td>39080</td>\n",
       "      <td>29430429</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>近30天</td>\n",
       "      <td>20220425</td>\n",
       "      <td>连衣裙</td>\n",
       "      <td>7985</td>\n",
       "      <td>1482300</td>\n",
       "      <td>530420</td>\n",
       "      <td>109004</td>\n",
       "      <td>265</td>\n",
       "      <td>50805</td>\n",
       "      <td>39122846</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>655</th>\n",
       "      <td>近30天</td>\n",
       "      <td>20220516</td>\n",
       "      <td>皮衣</td>\n",
       "      <td>34</td>\n",
       "      <td>930</td>\n",
       "      <td>279</td>\n",
       "      <td>350</td>\n",
       "      <td>45</td>\n",
       "      <td>44</td>\n",
       "      <td>23367</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>656</th>\n",
       "      <td>近30天</td>\n",
       "      <td>20220517</td>\n",
       "      <td>皮衣</td>\n",
       "      <td>21</td>\n",
       "      <td>2416</td>\n",
       "      <td>728</td>\n",
       "      <td>225</td>\n",
       "      <td>160</td>\n",
       "      <td>51</td>\n",
       "      <td>85163</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>657</th>\n",
       "      <td>近30天</td>\n",
       "      <td>20220518</td>\n",
       "      <td>皮衣</td>\n",
       "      <td>32</td>\n",
       "      <td>3468</td>\n",
       "      <td>647</td>\n",
       "      <td>348</td>\n",
       "      <td>139</td>\n",
       "      <td>72</td>\n",
       "      <td>42835</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>658</th>\n",
       "      <td>近30天</td>\n",
       "      <td>20220519</td>\n",
       "      <td>皮衣</td>\n",
       "      <td>30</td>\n",
       "      <td>1032</td>\n",
       "      <td>253</td>\n",
       "      <td>409</td>\n",
       "      <td>56</td>\n",
       "      <td>33</td>\n",
       "      <td>15166</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>659</th>\n",
       "      <td>近30天</td>\n",
       "      <td>20220520</td>\n",
       "      <td>皮衣</td>\n",
       "      <td>31</td>\n",
       "      <td>2995</td>\n",
       "      <td>839</td>\n",
       "      <td>269</td>\n",
       "      <td>132</td>\n",
       "      <td>81</td>\n",
       "      <td>161842</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>660 rows × 10 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "     日期维度        日期 行业名称  当日笔记篇数    当日点赞数   当日收藏数   当日评论数  平均互动量  当日分享数  \\\n",
       "0    近30天  20220421  连衣裙    8105  1526348  665187  131935    286  61854   \n",
       "1    近30天  20220422  连衣裙    8035  1554701  552797  125601    277  47520   \n",
       "2    近30天  20220423  连衣裙    7316  1810782  786336  103045    369  47970   \n",
       "3    近30天  20220424  连衣裙    7532  1140351  410110  105321    219  39080   \n",
       "4    近30天  20220425  连衣裙    7985  1482300  530420  109004    265  50805   \n",
       "..    ...       ...  ...     ...      ...     ...     ...    ...    ...   \n",
       "655  近30天  20220516   皮衣      34      930     279     350     45     44   \n",
       "656  近30天  20220517   皮衣      21     2416     728     225    160     51   \n",
       "657  近30天  20220518   皮衣      32     3468     647     348    139     72   \n",
       "658  近30天  20220519   皮衣      30     1032     253     409     56     33   \n",
       "659  近30天  20220520   皮衣      31     2995     839     269    132     81   \n",
       "\n",
       "        当日阅读数  \n",
       "0    41744057  \n",
       "1    46552553  \n",
       "2    41423076  \n",
       "3    29430429  \n",
       "4    39122846  \n",
       "..        ...  \n",
       "655     23367  \n",
       "656     85163  \n",
       "657     42835  \n",
       "658     15166  \n",
       "659    161842  \n",
       "\n",
       "[660 rows x 10 columns]"
      ]
     },
     "execution_count": 37,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#导入数据\n",
    "df8=pd.read_excel('服饰行业笔记数据趋势.xlsx')\n",
    "df8"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 38,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>行业名称</th>\n",
       "      <th>当日笔记篇数</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>连衣裙</td>\n",
       "      <td>221168</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>T恤</td>\n",
       "      <td>132231</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>休闲裤</td>\n",
       "      <td>89408</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>衬衫</td>\n",
       "      <td>50681</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>半身裙</td>\n",
       "      <td>37378</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>背心吊带</td>\n",
       "      <td>35871</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>西装西裤</td>\n",
       "      <td>32403</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>牛仔裤</td>\n",
       "      <td>29272</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>针织衫/毛衣</td>\n",
       "      <td>23214</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>运动茄克/外套</td>\n",
       "      <td>21145</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "      行业名称  当日笔记篇数\n",
       "0      连衣裙  221168\n",
       "1       T恤  132231\n",
       "2      休闲裤   89408\n",
       "3       衬衫   50681\n",
       "4      半身裙   37378\n",
       "5     背心吊带   35871\n",
       "6     西装西裤   32403\n",
       "7      牛仔裤   29272\n",
       "8   针织衫/毛衣   23214\n",
       "9  运动茄克/外套   21145"
      ]
     },
     "execution_count": 38,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_biji2 = df8.groupby(['行业名称']).agg({'当日笔记篇数': 'sum'}).sort_values(by='当日笔记篇数', ascending=False).reset_index().head(10)\n",
    "df_biji2"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 39,
   "metadata": {},
   "outputs": [],
   "source": [
    "hangye_list2 = df_biji2['行业名称'].tolist()\n",
    "biji_list2 = df_biji2['当日笔记篇数'].tolist()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 40,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts':'http://localhost:8888/nbextensions/assets/echarts.min'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "\n",
       "        <div id=\"3a9068b45455423c8c2895bf34e10da9\" style=\"width:900px; height:500px;\"></div>\n",
       "\n",
       "<script>\n",
       "        require(['echarts'], function(echarts) {\n",
       "                var chart_3a9068b45455423c8c2895bf34e10da9 = echarts.init(\n",
       "                    document.getElementById('3a9068b45455423c8c2895bf34e10da9'), 'white', {renderer: 'canvas'});\n",
       "                var option_3a9068b45455423c8c2895bf34e10da9 = {\n",
       "    \"animation\": true,\n",
       "    \"animationThreshold\": 2000,\n",
       "    \"animationDuration\": 1000,\n",
       "    \"animationEasing\": \"cubicOut\",\n",
       "    \"animationDelay\": 0,\n",
       "    \"animationDurationUpdate\": 300,\n",
       "    \"animationEasingUpdate\": \"cubicOut\",\n",
       "    \"animationDelayUpdate\": 0,\n",
       "    \"color\": [\n",
       "        \"#c23531\",\n",
       "        \"#2f4554\",\n",
       "        \"#61a0a8\",\n",
       "        \"#d48265\",\n",
       "        \"#749f83\",\n",
       "        \"#ca8622\",\n",
       "        \"#bda29a\",\n",
       "        \"#6e7074\",\n",
       "        \"#546570\",\n",
       "        \"#c4ccd3\",\n",
       "        \"#f05b72\",\n",
       "        \"#ef5b9c\",\n",
       "        \"#f47920\",\n",
       "        \"#905a3d\",\n",
       "        \"#fab27b\",\n",
       "        \"#2a5caa\",\n",
       "        \"#444693\",\n",
       "        \"#726930\",\n",
       "        \"#b2d235\",\n",
       "        \"#6d8346\",\n",
       "        \"#ac6767\",\n",
       "        \"#1d953f\",\n",
       "        \"#6950a1\",\n",
       "        \"#918597\"\n",
       "    ],\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"bar\",\n",
       "            \"name\": \"\\u603b\\u5171\\u7b14\\u8bb0\\u7bc7\\u6570\",\n",
       "            \"legendHoverLink\": true,\n",
       "            \"data\": [\n",
       "                221168,\n",
       "                132231,\n",
       "                89408,\n",
       "                50681,\n",
       "                37378,\n",
       "                35871,\n",
       "                32403,\n",
       "                29272,\n",
       "                23214,\n",
       "                21145\n",
       "            ],\n",
       "            \"showBackground\": false,\n",
       "            \"barMinHeight\": 0,\n",
       "            \"barCategoryGap\": \"20%\",\n",
       "            \"barGap\": \"30%\",\n",
       "            \"large\": false,\n",
       "            \"largeThreshold\": 400,\n",
       "            \"seriesLayoutBy\": \"column\",\n",
       "            \"datasetIndex\": 0,\n",
       "            \"clip\": true,\n",
       "            \"zlevel\": 0,\n",
       "            \"z\": 2,\n",
       "            \"label\": {\n",
       "                \"show\": true,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"\\u603b\\u5171\\u7b14\\u8bb0\\u7bc7\\u6570\"\n",
       "            ],\n",
       "            \"selected\": {\n",
       "                \"\\u603b\\u5171\\u7b14\\u8bb0\\u7bc7\\u6570\": true\n",
       "            },\n",
       "            \"show\": true,\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10,\n",
       "            \"itemWidth\": 25,\n",
       "            \"itemHeight\": 14\n",
       "        }\n",
       "    ],\n",
       "    \"tooltip\": {\n",
       "        \"show\": true,\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"showContent\": true,\n",
       "        \"alwaysShowContent\": false,\n",
       "        \"showDelay\": 0,\n",
       "        \"hideDelay\": 100,\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"borderWidth\": 0,\n",
       "        \"padding\": 5\n",
       "    },\n",
       "    \"xAxis\": [\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 0,\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": false,\n",
       "                \"lineStyle\": {\n",
       "                    \"show\": true,\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            },\n",
       "            \"data\": [\n",
       "                \"\\u8fde\\u8863\\u88d9\",\n",
       "                \"T\\u6064\",\n",
       "                \"\\u4f11\\u95f2\\u88e4\",\n",
       "                \"\\u886c\\u886b\",\n",
       "                \"\\u534a\\u8eab\\u88d9\",\n",
       "                \"\\u80cc\\u5fc3\\u540a\\u5e26\",\n",
       "                \"\\u897f\\u88c5\\u897f\\u88e4\",\n",
       "                \"\\u725b\\u4ed4\\u88e4\",\n",
       "                \"\\u9488\\u7ec7\\u886b/\\u6bdb\\u8863\",\n",
       "                \"\\u8fd0\\u52a8\\u8304\\u514b/\\u5916\\u5957\"\n",
       "            ]\n",
       "        }\n",
       "    ],\n",
       "    \"yAxis\": [\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 0,\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": false,\n",
       "                \"lineStyle\": {\n",
       "                    \"show\": true,\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"title\": [\n",
       "        {\n",
       "            \"text\": \"\\u670d\\u9970\\u54c1\\u7c7b\\u7b14\\u8bb0\\u603b\\u7bc7\\u6570Top10\",\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10\n",
       "        }\n",
       "    ],\n",
       "    \"dataZoom\": {\n",
       "        \"show\": true,\n",
       "        \"type\": \"slider\",\n",
       "        \"realtime\": true,\n",
       "        \"start\": 20,\n",
       "        \"end\": 80,\n",
       "        \"orient\": \"horizontal\",\n",
       "        \"zoomLock\": false,\n",
       "        \"filterMode\": \"filter\"\n",
       "    }\n",
       "};\n",
       "                chart_3a9068b45455423c8c2895bf34e10da9.setOption(option_3a9068b45455423c8c2895bf34e10da9);\n",
       "        });\n",
       "    </script>\n"
      ],
      "text/plain": [
       "<pyecharts.render.display.HTML at 0x1e5d0628c40>"
      ]
     },
     "execution_count": 40,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from pyecharts import options as opts\n",
    "from pyecharts.charts import Bar\n",
    "\n",
    "c = (\n",
    "    Bar()\n",
    "    .add_xaxis(hangye_list2)\n",
    "    .add_yaxis(\"总共笔记篇数\", biji_list2)\n",
    "    .set_global_opts(\n",
    "        title_opts=opts.TitleOpts(title=\"服饰品类笔记总篇数Top10\"),\n",
    "        datazoom_opts=opts.DataZoomOpts(),\n",
    "    )\n",
    "    \n",
    ")\n",
    "c.render_notebook()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 服饰品类笔记收藏率"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 41,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>当日收藏数</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>行业名称</th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>T恤</th>\n",
       "      <td>8248749</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>polo衫</th>\n",
       "      <td>247723</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>休闲裤</th>\n",
       "      <td>6108179</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>半身裙</th>\n",
       "      <td>2687030</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>卫衣/绒衫</th>\n",
       "      <td>434336</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>大衣</th>\n",
       "      <td>258386</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>夹克</th>\n",
       "      <td>99092</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>棉衣</th>\n",
       "      <td>115756</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>牛仔裤</th>\n",
       "      <td>2191480</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>皮衣</th>\n",
       "      <td>44032</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>羽绒服</th>\n",
       "      <td>130838</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>背心吊带</th>\n",
       "      <td>3577914</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>蕾丝雪纺衫</th>\n",
       "      <td>55772</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>衬衫</th>\n",
       "      <td>3299823</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>西装西裤</th>\n",
       "      <td>1572257</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>运动卫衣/套头衫</th>\n",
       "      <td>19878</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>运动茄克/外套</th>\n",
       "      <td>1383462</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>连体裤</th>\n",
       "      <td>312980</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>连衣裙</th>\n",
       "      <td>11376306</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>针织衫/毛衣</th>\n",
       "      <td>1575820</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>风衣</th>\n",
       "      <td>87516</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>马甲</th>\n",
       "      <td>2928492</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "             当日收藏数\n",
       "行业名称              \n",
       "T恤         8248749\n",
       "polo衫       247723\n",
       "休闲裤        6108179\n",
       "半身裙        2687030\n",
       "卫衣/绒衫       434336\n",
       "大衣          258386\n",
       "夹克           99092\n",
       "棉衣          115756\n",
       "牛仔裤        2191480\n",
       "皮衣           44032\n",
       "羽绒服         130838\n",
       "背心吊带       3577914\n",
       "蕾丝雪纺衫        55772\n",
       "衬衫         3299823\n",
       "西装西裤       1572257\n",
       "运动卫衣/套头衫     19878\n",
       "运动茄克/外套    1383462\n",
       "连体裤         312980\n",
       "连衣裙       11376306\n",
       "针织衫/毛衣     1575820\n",
       "风衣           87516\n",
       "马甲         2928492"
      ]
     },
     "execution_count": 41,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_shoucang = df8.groupby('行业名称')['当日收藏数'].agg([('当日收藏数',sum)])\n",
    "df_shoucang "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 42,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>当日阅读数</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>行业名称</th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>T恤</th>\n",
       "      <td>546426299</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>polo衫</th>\n",
       "      <td>19479180</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>休闲裤</th>\n",
       "      <td>427333193</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>半身裙</th>\n",
       "      <td>200603269</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>卫衣/绒衫</th>\n",
       "      <td>29799383</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>大衣</th>\n",
       "      <td>15863972</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>夹克</th>\n",
       "      <td>11344049</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>棉衣</th>\n",
       "      <td>14413354</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>牛仔裤</th>\n",
       "      <td>145500736</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>皮衣</th>\n",
       "      <td>4587906</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>羽绒服</th>\n",
       "      <td>7830810</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>背心吊带</th>\n",
       "      <td>216111335</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>蕾丝雪纺衫</th>\n",
       "      <td>3785301</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>衬衫</th>\n",
       "      <td>250230751</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>西装西裤</th>\n",
       "      <td>130775418</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>运动卫衣/套头衫</th>\n",
       "      <td>3059850</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>运动茄克/外套</th>\n",
       "      <td>111484426</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>连体裤</th>\n",
       "      <td>19276594</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>连衣裙</th>\n",
       "      <td>826017280</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>针织衫/毛衣</th>\n",
       "      <td>109604409</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>风衣</th>\n",
       "      <td>7350742</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>马甲</th>\n",
       "      <td>115786802</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "              当日阅读数\n",
       "行业名称               \n",
       "T恤        546426299\n",
       "polo衫      19479180\n",
       "休闲裤       427333193\n",
       "半身裙       200603269\n",
       "卫衣/绒衫      29799383\n",
       "大衣         15863972\n",
       "夹克         11344049\n",
       "棉衣         14413354\n",
       "牛仔裤       145500736\n",
       "皮衣          4587906\n",
       "羽绒服         7830810\n",
       "背心吊带      216111335\n",
       "蕾丝雪纺衫       3785301\n",
       "衬衫        250230751\n",
       "西装西裤      130775418\n",
       "运动卫衣/套头衫    3059850\n",
       "运动茄克/外套   111484426\n",
       "连体裤        19276594\n",
       "连衣裙       826017280\n",
       "针织衫/毛衣    109604409\n",
       "风衣          7350742\n",
       "马甲        115786802"
      ]
     },
     "execution_count": 42,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_yuedu = df8.groupby('行业名称')['当日阅读数'].agg([('当日阅读数',sum)])\n",
    "df_yuedu "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 43,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>当日收藏数</th>\n",
       "      <th>当日阅读数</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>行业名称</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>T恤</th>\n",
       "      <td>8248749</td>\n",
       "      <td>546426299</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>polo衫</th>\n",
       "      <td>247723</td>\n",
       "      <td>19479180</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>休闲裤</th>\n",
       "      <td>6108179</td>\n",
       "      <td>427333193</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>半身裙</th>\n",
       "      <td>2687030</td>\n",
       "      <td>200603269</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>卫衣/绒衫</th>\n",
       "      <td>434336</td>\n",
       "      <td>29799383</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>大衣</th>\n",
       "      <td>258386</td>\n",
       "      <td>15863972</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>夹克</th>\n",
       "      <td>99092</td>\n",
       "      <td>11344049</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>棉衣</th>\n",
       "      <td>115756</td>\n",
       "      <td>14413354</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>牛仔裤</th>\n",
       "      <td>2191480</td>\n",
       "      <td>145500736</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>皮衣</th>\n",
       "      <td>44032</td>\n",
       "      <td>4587906</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>羽绒服</th>\n",
       "      <td>130838</td>\n",
       "      <td>7830810</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>背心吊带</th>\n",
       "      <td>3577914</td>\n",
       "      <td>216111335</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>蕾丝雪纺衫</th>\n",
       "      <td>55772</td>\n",
       "      <td>3785301</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>衬衫</th>\n",
       "      <td>3299823</td>\n",
       "      <td>250230751</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>西装西裤</th>\n",
       "      <td>1572257</td>\n",
       "      <td>130775418</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>运动卫衣/套头衫</th>\n",
       "      <td>19878</td>\n",
       "      <td>3059850</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>运动茄克/外套</th>\n",
       "      <td>1383462</td>\n",
       "      <td>111484426</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>连体裤</th>\n",
       "      <td>312980</td>\n",
       "      <td>19276594</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>连衣裙</th>\n",
       "      <td>11376306</td>\n",
       "      <td>826017280</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>针织衫/毛衣</th>\n",
       "      <td>1575820</td>\n",
       "      <td>109604409</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>风衣</th>\n",
       "      <td>87516</td>\n",
       "      <td>7350742</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>马甲</th>\n",
       "      <td>2928492</td>\n",
       "      <td>115786802</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "             当日收藏数      当日阅读数\n",
       "行业名称                         \n",
       "T恤         8248749  546426299\n",
       "polo衫       247723   19479180\n",
       "休闲裤        6108179  427333193\n",
       "半身裙        2687030  200603269\n",
       "卫衣/绒衫       434336   29799383\n",
       "大衣          258386   15863972\n",
       "夹克           99092   11344049\n",
       "棉衣          115756   14413354\n",
       "牛仔裤        2191480  145500736\n",
       "皮衣           44032    4587906\n",
       "羽绒服         130838    7830810\n",
       "背心吊带       3577914  216111335\n",
       "蕾丝雪纺衫        55772    3785301\n",
       "衬衫         3299823  250230751\n",
       "西装西裤       1572257  130775418\n",
       "运动卫衣/套头衫     19878    3059850\n",
       "运动茄克/外套    1383462  111484426\n",
       "连体裤         312980   19276594\n",
       "连衣裙       11376306  826017280\n",
       "针织衫/毛衣     1575820  109604409\n",
       "风衣           87516    7350742\n",
       "马甲         2928492  115786802"
      ]
     },
     "execution_count": 43,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_rate = pd.merge(df_shoucang, df_yuedu,on=['行业名称'])\n",
    "df_rate"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 44,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>行业名称</th>\n",
       "      <th>当日收藏数</th>\n",
       "      <th>当日阅读数</th>\n",
       "      <th>收藏率%</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>马甲</td>\n",
       "      <td>2928492</td>\n",
       "      <td>115786802</td>\n",
       "      <td>2.529211</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>羽绒服</td>\n",
       "      <td>130838</td>\n",
       "      <td>7830810</td>\n",
       "      <td>1.670811</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>背心吊带</td>\n",
       "      <td>3577914</td>\n",
       "      <td>216111335</td>\n",
       "      <td>1.655588</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>大衣</td>\n",
       "      <td>258386</td>\n",
       "      <td>15863972</td>\n",
       "      <td>1.628760</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>连体裤</td>\n",
       "      <td>312980</td>\n",
       "      <td>19276594</td>\n",
       "      <td>1.623627</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>T恤</td>\n",
       "      <td>8248749</td>\n",
       "      <td>546426299</td>\n",
       "      <td>1.509581</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>牛仔裤</td>\n",
       "      <td>2191480</td>\n",
       "      <td>145500736</td>\n",
       "      <td>1.506164</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>蕾丝雪纺衫</td>\n",
       "      <td>55772</td>\n",
       "      <td>3785301</td>\n",
       "      <td>1.473383</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>卫衣/绒衫</td>\n",
       "      <td>434336</td>\n",
       "      <td>29799383</td>\n",
       "      <td>1.457534</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>针织衫/毛衣</td>\n",
       "      <td>1575820</td>\n",
       "      <td>109604409</td>\n",
       "      <td>1.437734</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "     行业名称    当日收藏数      当日阅读数      收藏率%\n",
       "0      马甲  2928492  115786802  2.529211\n",
       "1     羽绒服   130838    7830810  1.670811\n",
       "2    背心吊带  3577914  216111335  1.655588\n",
       "3      大衣   258386   15863972  1.628760\n",
       "4     连体裤   312980   19276594  1.623627\n",
       "5      T恤  8248749  546426299  1.509581\n",
       "6     牛仔裤  2191480  145500736  1.506164\n",
       "7   蕾丝雪纺衫    55772    3785301  1.473383\n",
       "8   卫衣/绒衫   434336   29799383  1.457534\n",
       "9  针织衫/毛衣  1575820  109604409  1.437734"
      ]
     },
     "execution_count": 44,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_rate['收藏率%'] = df_rate['当日收藏数'] / df_rate['当日阅读数'] *100\n",
    "df_rate2 = df_rate.sort_values(by='收藏率%', ascending=False).reset_index().head(10)\n",
    "df_rate2"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 45,
   "metadata": {},
   "outputs": [],
   "source": [
    "hangye_list3 = df_rate2['行业名称'].tolist()\n",
    "rate_list = df_rate2['收藏率%'].tolist()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 46,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts':'http://localhost:8888/nbextensions/assets/echarts.min'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "\n",
       "        <div id=\"ebd592da577d4155898b8adcef082799\" style=\"width:900px; height:500px;\"></div>\n",
       "\n",
       "<script>\n",
       "        require(['echarts'], function(echarts) {\n",
       "                var chart_ebd592da577d4155898b8adcef082799 = echarts.init(\n",
       "                    document.getElementById('ebd592da577d4155898b8adcef082799'), 'white', {renderer: 'canvas'});\n",
       "                var option_ebd592da577d4155898b8adcef082799 = {\n",
       "    \"animation\": true,\n",
       "    \"animationThreshold\": 2000,\n",
       "    \"animationDuration\": 1000,\n",
       "    \"animationEasing\": \"cubicOut\",\n",
       "    \"animationDelay\": 0,\n",
       "    \"animationDurationUpdate\": 300,\n",
       "    \"animationEasingUpdate\": \"cubicOut\",\n",
       "    \"animationDelayUpdate\": 0,\n",
       "    \"color\": [\n",
       "        \"#c23531\",\n",
       "        \"#2f4554\",\n",
       "        \"#61a0a8\",\n",
       "        \"#d48265\",\n",
       "        \"#749f83\",\n",
       "        \"#ca8622\",\n",
       "        \"#bda29a\",\n",
       "        \"#6e7074\",\n",
       "        \"#546570\",\n",
       "        \"#c4ccd3\",\n",
       "        \"#f05b72\",\n",
       "        \"#ef5b9c\",\n",
       "        \"#f47920\",\n",
       "        \"#905a3d\",\n",
       "        \"#fab27b\",\n",
       "        \"#2a5caa\",\n",
       "        \"#444693\",\n",
       "        \"#726930\",\n",
       "        \"#b2d235\",\n",
       "        \"#6d8346\",\n",
       "        \"#ac6767\",\n",
       "        \"#1d953f\",\n",
       "        \"#6950a1\",\n",
       "        \"#918597\"\n",
       "    ],\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"bar\",\n",
       "            \"name\": \"\\u670d\\u9970\\u54c1\\u7c7b\\u7b14\\u8bb0\\u6536\\u85cf\\u7387\",\n",
       "            \"legendHoverLink\": true,\n",
       "            \"data\": [\n",
       "                2.5292105399024667,\n",
       "                1.6708105547191159,\n",
       "                1.655588310534475,\n",
       "                1.6287598087036461,\n",
       "                1.623627078518124,\n",
       "                1.5095812582768824,\n",
       "                1.5061642024958555,\n",
       "                1.4733834905070957,\n",
       "                1.4575335334963144,\n",
       "                1.437734133487276\n",
       "            ],\n",
       "            \"showBackground\": false,\n",
       "            \"barMinHeight\": 0,\n",
       "            \"barCategoryGap\": \"20%\",\n",
       "            \"barGap\": \"30%\",\n",
       "            \"large\": false,\n",
       "            \"largeThreshold\": 400,\n",
       "            \"seriesLayoutBy\": \"column\",\n",
       "            \"datasetIndex\": 0,\n",
       "            \"clip\": true,\n",
       "            \"zlevel\": 0,\n",
       "            \"z\": 2,\n",
       "            \"label\": {\n",
       "                \"show\": true,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"\\u670d\\u9970\\u54c1\\u7c7b\\u7b14\\u8bb0\\u6536\\u85cf\\u7387\"\n",
       "            ],\n",
       "            \"selected\": {\n",
       "                \"\\u670d\\u9970\\u54c1\\u7c7b\\u7b14\\u8bb0\\u6536\\u85cf\\u7387\": true\n",
       "            },\n",
       "            \"show\": true,\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10,\n",
       "            \"itemWidth\": 25,\n",
       "            \"itemHeight\": 14\n",
       "        }\n",
       "    ],\n",
       "    \"tooltip\": {\n",
       "        \"show\": true,\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"showContent\": true,\n",
       "        \"alwaysShowContent\": false,\n",
       "        \"showDelay\": 0,\n",
       "        \"hideDelay\": 100,\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"borderWidth\": 0,\n",
       "        \"padding\": 5\n",
       "    },\n",
       "    \"xAxis\": [\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 0,\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": false,\n",
       "                \"lineStyle\": {\n",
       "                    \"show\": true,\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            },\n",
       "            \"data\": [\n",
       "                \"\\u9a6c\\u7532\",\n",
       "                \"\\u7fbd\\u7ed2\\u670d\",\n",
       "                \"\\u80cc\\u5fc3\\u540a\\u5e26\",\n",
       "                \"\\u5927\\u8863\",\n",
       "                \"\\u8fde\\u4f53\\u88e4\",\n",
       "                \"T\\u6064\",\n",
       "                \"\\u725b\\u4ed4\\u88e4\",\n",
       "                \"\\u857e\\u4e1d\\u96ea\\u7eba\\u886b\",\n",
       "                \"\\u536b\\u8863/\\u7ed2\\u886b\",\n",
       "                \"\\u9488\\u7ec7\\u886b/\\u6bdb\\u8863\"\n",
       "            ]\n",
       "        }\n",
       "    ],\n",
       "    \"yAxis\": [\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 0,\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": false,\n",
       "                \"lineStyle\": {\n",
       "                    \"show\": true,\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"title\": [\n",
       "        {\n",
       "            \"text\": \"\\u670d\\u9970\\u54c1\\u7c7b\\u7b14\\u8bb0\\u6536\\u85cf\\u7387Top10\",\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10\n",
       "        }\n",
       "    ],\n",
       "    \"dataZoom\": {\n",
       "        \"show\": true,\n",
       "        \"type\": \"slider\",\n",
       "        \"realtime\": true,\n",
       "        \"start\": 20,\n",
       "        \"end\": 80,\n",
       "        \"orient\": \"horizontal\",\n",
       "        \"zoomLock\": false,\n",
       "        \"filterMode\": \"filter\"\n",
       "    }\n",
       "};\n",
       "                chart_ebd592da577d4155898b8adcef082799.setOption(option_ebd592da577d4155898b8adcef082799);\n",
       "        });\n",
       "    </script>\n"
      ],
      "text/plain": [
       "<pyecharts.render.display.HTML at 0x1e5d0242700>"
      ]
     },
     "execution_count": 46,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from pyecharts import options as opts\n",
    "from pyecharts.charts import Bar\n",
    "\n",
    "c = (\n",
    "    Bar()\n",
    "    .add_xaxis(hangye_list3)\n",
    "    .add_yaxis(\"服饰品类笔记收藏率\", rate_list)\n",
    "    .set_global_opts(\n",
    "        title_opts=opts.TitleOpts(title=\"服饰品类笔记收藏率Top10\"),\n",
    "        datazoom_opts=opts.DataZoomOpts(),\n",
    "    )\n",
    "    \n",
    ")\n",
    "c.render_notebook()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.3"
  },
  "toc": {
   "base_numbering": 1,
   "nav_menu": {},
   "number_sections": true,
   "sideBar": true,
   "skip_h1_title": false,
   "title_cell": "Table of Contents",
   "title_sidebar": "Contents",
   "toc_cell": false,
   "toc_position": {
    "height": "648.444px",
    "left": "805px",
    "top": "353.139px",
    "width": "341.319px"
   },
   "toc_section_display": true,
   "toc_window_display": true
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
